[hidden]{display:none!important}
body[data-page]:not([data-page=command]) #command,body[data-page]:not([data-page=command]) .rebirth-hero{display:none!important}
body[data-page=command] #research,body[data-page=command] #exploration{display:none!important}
body[data-page]:not([data-page=market]) #market,body[data-page]:not([data-page=alliances]) #alliances,body[data-page]:not([data-page=diplomacy]) #diplomacy,body[data-page]:not([data-page=military]) #military,body[data-page]:not([data-page=government]) #government,body[data-page]:not([data-page=world]) #world,body[data-page]:not([data-page=atlas]) #atlas{display:none!important}
.game-header nav a[aria-current=page],nav a[aria-current=page]{color:#f3d298;border-bottom:2px solid #dbb16d;background:#d9b56c12}
.page-location{margin:1.5rem clamp(.75rem,3vw,2rem);padding:1.25rem 1.5rem;border-left:3px solid #d2ad70;background:linear-gradient(110deg,#18343a,#0b2029);display:flex;align-items:center;justify-content:space-between;gap:1rem}
.page-location p{font-size:.62rem;letter-spacing:.2em;color:#c4ad81;margin:0 0 .4rem}.page-location h2{margin:0;font-size:1.7rem}.page-location a{font-size:.8rem}
#page-content{margin:1.5rem clamp(.75rem,3vw,2rem)}#page-content:empty{display:none}#page-content>.research-panel{margin:0;padding:1.5rem;border:1px solid #466062;background:#0e2630}
.page-access-note{padding:2rem;border:1px solid #466062;background:#0e2630}#city-message:empty{display:none}
@media(max-width:650px){.page-location{align-items:flex-start;flex-direction:column}#page-content>.research-panel{padding:1rem}}

.game-shell .game-header { position: sticky; top: 0; z-index: 40; background: #0c2028; }
body.game-shell[data-page="command"] .game-header { display: block !important; }
.game-shell .game-header .brand, .game-shell .game-header .header-motto { display: none; }
.game-shell .game-header nav { display: flex; flex-wrap: nowrap; overflow-x: auto; }
.game-shell .game-header nav a { flex: none; white-space: nowrap; }
.game-shell .settlement-view.rts-camp { top: var(--game-header-height, 72px); }
.game-shell .game-hud { display: flex; align-items: center; gap: .75rem; justify-content: space-between; padding: .35rem .75rem; border-top: 1px solid #36515b; font-size: .75rem; }
.game-shell .game-hud [data-game-resources] { display: flex; gap: .8rem; overflow-x: auto; }
.game-shell .game-hud span, .game-shell .game-hud time { white-space: nowrap; }
#expedition-content { margin: 1.5rem clamp(.75rem,3vw,2rem); }
.game-shell :is(#page-content,#expedition-content,#security-root,#community-main,.module-screen) { scroll-margin-top: var(--game-header-height, 72px); }
.game-shell .game-header { padding: .25rem clamp(.35rem, 2vw, 1rem); }
.game-shell .game-header nav { margin: 0; padding: 0; border: 0; }
.game-shell .bottom-nav { display: none !important; }

.game-shell .game-header nav a { align-items: center; gap: .45rem; border: 1px solid transparent; border-radius: 6px; text-transform: none; }
.game-shell .game-header nav a[aria-current=page] { border-color: #8f754a; color: #ffda99; background: #263331; }
.game-shell .game-header nav .game-home { color: #f1cc8e; margin-inline-end: .25rem; border-inline-end-color: #39525a; }
.game-shell .game-resource { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .5rem; border: 1px solid #294651; border-radius: 6px; background: #102832; font-variant-numeric: tabular-nums; }
.game-resource svg { flex: none; }
:is(.game-resource[data-resource="credits"], .rts-res[data-rts-resource="credits"]) svg { color: #f0bf68; }
:is(.game-resource[data-resource="food"], .rts-res[data-rts-resource="food"]) svg { color: #aad181; }
:is(.game-resource[data-resource="water"], .rts-res[data-rts-resource="water"]) svg { color: #78c8ec; }
:is(.game-resource[data-resource="energy"], .rts-res[data-rts-resource="energy"]) svg { color: #ffcf72; }
:is(.game-resource[data-resource="materials"], .rts-res[data-rts-resource="materials"]) svg { color: #e8a482; }
:is(.game-resource[data-resource="technology"], .rts-res[data-rts-resource="technology"]) svg { color: #c5acff; }

/* Reclaimed Future: the common console sits above every game route. */
.game-shell {
  --rf-stone: #f2ede2;
  --rf-paper: #f8f7f1;
  --rf-sage: #e3e8e2;
  --rf-line: #bdc9c1;
  --rf-ink: #24343a;
  --rf-teal: #386f73;
  --rf-amber: #a75e27;
  --rf-muted: #4e6267;
  --rf-link: #27585b;
  --rf-danger: #8c302d;
  --rf-warning: #81511c;
}
.game-shell:not([data-page="command"]) { background: var(--rf-stone); }
.game-shell .game-header { overflow: visible; background: var(--rf-paper); color: var(--rf-ink); border-color: var(--rf-line); box-shadow: 0 3px 12px #24343a18; }
.game-shell .game-header nav { overflow: visible; flex-wrap: wrap; align-items: center; gap: .2rem; }
.game-shell .game-header nav a, .game-directory summary { color: var(--rf-ink); background: transparent; padding: .35rem .65rem; }
.game-shell .game-header nav a[aria-current="page"], .game-directory.has-active-section summary { color: #214e50; background: var(--rf-sage); border-color: #92aaa2; }
.game-shell .game-header nav .game-home { color: var(--rf-teal); border-inline-end-color: var(--rf-line); }
.game-shell .game-home img { border-radius: 50%; background: #254347; }
.game-directory { position: relative; }
.game-directory summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .35rem; border: 1px solid transparent; border-radius: 6px; }
.game-directory summary::after { content: '⌄'; }
.game-directory > div { position: absolute; inset-inline-end: 0; top: calc(100% + .25rem); min-width: 12rem; padding: .35rem; display: grid; gap: .15rem; border: 1px solid var(--rf-line); border-radius: 8px; background: var(--rf-paper); box-shadow: 0 9px 24px #24343a30; }
.game-directory:not([open]) > div { display: none; }
.game-shell .game-hud { border-color: var(--rf-line); }
.game-shell .game-hud [data-game-resources] { flex-wrap: wrap; gap: .25rem; overflow: visible; min-width: 0; }
.game-shell .game-resource { background: var(--rf-sage); border-color: transparent; color: var(--rf-ink); font-size: .82rem; }
.game-resource-rate { color: #286752; font-size: .72rem; }
.game-resource-rate[data-loss="true"] { color: #a03d37; }
.game-resource[data-resource="credits"] svg, .game-resource[data-resource="energy"] svg { color: #915510; }
.game-resource[data-resource="food"] svg { color: #4b6933; }
.game-resource[data-resource="water"] svg { color: #246487; }
.game-resource[data-resource="materials"] svg { color: #994d34; }
.game-resource[data-resource="technology"] svg { color: #674b96; }
.game-shell [data-game-inventory] { display: none; }
.game-shell .rts-hud__resources { display: none; }
.game-shell .page-location { background: var(--rf-sage); color: var(--rf-ink); border-color: var(--rf-teal); }
.game-shell .page-location p, .game-shell .page-location a { color: #305c60; }
@media(max-width: 900px) {
  .game-shell .game-header nav > a:not(.game-home):not([href="/settlement"]):not([aria-current="page"]):not(.game-directory a) { display: none; }
  .game-directory { margin-inline-start: auto; }
  .game-shell .game-hud { flex-wrap: wrap; justify-content: flex-start; padding: .25rem; gap: .3rem; }
  .game-shell .game-hud:not(.inventory-open) .game-resource:nth-child(n+4) { display: none; }
  .game-shell [data-game-inventory] { display: inline-flex; align-items: center; min-height: 44px; padding: .25rem .4rem; background: var(--rf-sage); color: var(--rf-ink); border: 1px solid var(--rf-line); border-radius: 6px; }
  .game-shell .game-resource-rate { display: none; }
}
.game-shell[data-page="command"] .game-status { display: none; }
.game-shell .dev-shell { border-radius: 12px; overflow: clip; }
.game-shell .dev-shell .dev-heading h2 { font-size: clamp(1.85rem, 3vw, 3rem) !important; }
.game-shell .dev-shell .dev-heading { padding-block: 1.25rem !important; }
.game-shell .dev-detail { top: var(--game-header-height, 80px); }
.game-shell :is(a,button,summary):focus-visible { outline: 2px solid #548f8e; outline-offset: 2px; }

.game-shell .game-header::after { display: none; }
.game-shell .game-header :is(.waz-icon,.game-home img) { flex: 0 0 20px; width: 20px; height: 20px; padding: 0; border: 0; background: transparent; }
.game-shell .game-header .game-home img { background: #254347; }
.game-shell .game-hud .waz-icon { flex-basis: 20px; }
.game-shell .rts-hudchip .waz-icon { width: 18px; height: 18px; padding: 0; border: 0; background: transparent; }
.game-shell[data-page="command"] { overflow-x: clip; }

.game-shell :is(.section-heading,.sec-intro,.c-intro) { border-color: var(--rf-line); }
.game-shell :is(.sec-intro,.c-intro) { color: var(--rf-ink); }
.game-shell :is(.sec-intro .sec-lede,.c-intro .c-lede) { color: #4e6267; }
.game-shell :is(.sec-intro .sec-kicker,.c-intro .eyebrow) { color: #865017 !important; }
.game-shell .sec-tabs { top: var(--game-header-height, 80px); background: var(--rf-sage); border-radius: 7px; padding-inline: .35rem; }
.game-shell .sec-tabs .sec-tab { color: var(--rf-ink); background: var(--rf-paper); border-color: var(--rf-line); }
.game-shell .sec-tabs .sec-tab[aria-selected="true"] { background: #386f73; color: white; border-color: #386f73; }

/* Shared reading surfaces for the market, embassies and alliance offices. */
.game-shell [data-market-view="auren-market"] {
  --mv-panel: var(--rf-paper);
  --mv-panel-2: var(--rf-sage);
  --mv-inset: #edece4;
  --mv-edge: var(--rf-line);
  --mv-edge-strong: #8da59a;
  --mv-text: var(--rf-ink);
  --mv-text-2: #42595e;
  --mv-muted: #52666a;
  --mv-amber: #87521e;
  --mv-amber-2: #85501c;
  --mv-growth: #286752;
  --mv-danger: #a03d37;
  --mv-warning: #835018;
  --mv-info: #245f7a;
  --mv-locked: #59666c;
  --mv-radius: 9px;
}
.game-shell :is([data-alliance-view="auren-alliance"],[data-diplomacy-view="auren-diplomacy"]) {
  --soc-panel: var(--rf-paper);
  --soc-panel-2: var(--rf-sage);
  --soc-inset: #edece4;
  --soc-edge: var(--rf-line);
  --soc-edge-strong: #8da59a;
  --soc-text: var(--rf-ink);
  --soc-text-2: #42595e;
  --soc-muted: #52666a;
  --soc-amber: #87521e;
  --soc-amber-2: #85501c;
  --soc-growth: #286752;
  --soc-danger: #a03d37;
  --soc-warning: #835018;
  --soc-info: #245f7a;
  --soc-locked: #59666c;
  --soc-radius: 9px;
}
.game-shell :is(.exp-head,.world-head,.section-heading) {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: var(--rf-line);
  border-radius: 10px;
}
.game-shell :is(.exp-head,.world-head) :is(.exp-kicker,.world-kicker,.exp-toggle) { color: #87521e; }
.game-shell :is(.exp-head,.world-head) :is(.exp-sub,.world-sub) { color: #52666a; }
.game-shell .section-heading .eyebrow { color: #87521e !important; }

.game-shell :is(#market,#alliances,#diplomacy).module-screen {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: var(--rf-line);
  box-shadow: 0 8px 26px #24343a16;
}
.game-shell :is(#market,#alliances,#diplomacy) .live-stamp { color: #456369; }

.game-account-tools { display: flex; align-items: center; gap: .35rem; margin-inline-start: auto; }
.game-shell[data-page="command"] .game-account-tools { display: none; }
.game-account { position: relative; }
.game-account summary, .game-account-tools button {
  cursor: pointer; min-height: 44px; padding: .35rem .55rem; background: var(--rf-sage);
  color: var(--rf-ink); border: 1px solid var(--rf-line); border-radius: 7px;
}
.game-account summary { align-content: center; }
.game-account > div {
  position: absolute; inset-inline-end: 0; z-index: 2; min-width: 11rem;
  padding: .4rem; display: grid; gap: .3rem; background: var(--rf-paper);
  border: 1px solid var(--rf-line); border-radius: 8px; box-shadow: 0 9px 24px #24343a30;
}
.game-account:not([open]) > div { display: none; }
.game-account a { color: #275456; padding: .65rem; }
.game-account-tools [data-game-dispatches] { display: inline-flex; align-items: center; gap: .25rem; }

/* Light reading surfaces around the interactive terrain. */
.game-shell :is(.exp-mappanel,.exp-panel,.world-mappanel,.world-panel,.sec-card) {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: var(--rf-line);
  border-radius: 10px;
}
.game-shell :is(.exp-panel-title,.world-paneltitle) { color: #87521e; }
.game-shell :is(.exp-panel-note,.world-panelnote,.exp-site__meta,.exp-site__stats,.world-fact__label,.sec-hint,.sec-empty) { color: #52666a; }
.game-shell :is(.exp-site,.exp-filter,.world-fact,.world-faction,.world-event,.world-notification) {
  background: var(--rf-sage);
  color: var(--rf-ink);
}
.game-shell :is(.world-fact__value,.world-faction h3,.world-event h3,.sec-card h2,.sec-card h3,.sec-card h4,.sec-dash) { color: var(--rf-ink); }
.game-shell .exp-filter[aria-pressed="true"], .game-shell .exp-site--selected { background: #d2e3da; color: #214e50; border-color: #527970; }
.game-shell .sec-card { --status-warning:#81511c; --status-growth:#286752; --status-danger:#a03d37; }
/* Security retains its layout while using the shared ivory reading palette. */
.game-shell .security-main :is(.sec-factor,.sec-row,.sec-faction,.sec-state,.sec-command__recommendation) { background:#e3e8e1; color:#24383b; }
.game-shell .security-main :is(.sec-live:not(:empty),.sec-gauge__value,.sec-gauge__value strong,.sec-factor__label,.sec-factor__values,.sec-factor__detail,.sec-row,.sec-row strong,.sec-row span,.sec-stats dt,.sec-stats dd,.sec-command__score span,.sec-command__recommendation p,.sec-command__severity,.sec-lede,.sec-state) { color:#294b4e; }
.game-shell .security-main .sec-command__score strong { color:#81511c; }
.game-shell .security-main .sec-live--error:not(:empty) { color:#943b33; }
.game-shell .security-main .sec-fold summary { color:#81511c; }
.game-shell .security-main .sec-button { background:#e3e8e1; color:#294b4e; border-color:#a7b9b0; }
.game-shell .security-main .sec-button:hover:not(:disabled) { background:#d2e3da; }
.game-shell .security-main .sec-battle :is(h3,h4) { color:#f0eee5; }
.game-boot { display: inline-flex; align-items: center; gap: .7rem; color: #e8e9df; }
.game-boot img { background: #244448; border-radius: 10px; }

/* Keep one page heading and let the application surfaces define the layout. */
.game-shell :is(#market,#alliances,#diplomacy,#world).module-screen,
.game-shell #expedition-content #exploration {
  max-width: none;
  margin-inline: clamp(.65rem, 2vw, 2rem);
  padding: 0;
  background: transparent;
  color: var(--rf-ink);
  border: 0;
  box-shadow: none;
}
.game-shell #expedition-content #exploration { margin-inline: 0; }
.game-shell:has(:is(
  #expedition-content:not([hidden]) .exp-head,
  #page-content:not([hidden]) .dev-heading,
  #security-root:not([hidden]) .sec-intro,
  #community-main:not([hidden]) .c-intro,
  .module-screen:not([hidden]) > .section-heading,
  .atlas-layout:not([hidden]) .section-heading
)) .page-location { display: none; }
.game-shell :is(#market:has(.mv-head),#world:has(.world-head)) > .section-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.game-shell .world-app {
  --w-bg: var(--rf-sage);
  --w-panel: var(--rf-paper);
  --w-edge: var(--rf-line);
  --w-amber: #87521e;
  --w-muted: #52666a;
  --w-ink: var(--rf-ink);
}
.game-shell :is(.world-layer,.world-zoombtn,.world-chip,.exp-chip,.exp-toggle) {
  color: var(--rf-ink);
  background: var(--rf-sage);
  border-color: var(--rf-line);
}
.game-shell :is(.world-layer[aria-pressed="true"],.exp-chip--active) {
  color: #214e50;
  background: #d2e3da;
  border-color: #527970;
}
.game-shell .world-viewport { background: #dbe4dd; }
.game-shell .game-directory[hidden] { display: none; }
.game-shell #expedition-content .exp-view {
  --exp-bg: var(--rf-sage);
  --exp-panel: var(--rf-paper);
  --exp-edge: var(--rf-line);
  --exp-amber: #87521e;
  --exp-muted: #52666a;
  --exp-ink: var(--rf-ink);
}
.game-shell :is(.world-province-btn,.world-input,.world-action) {
  background: var(--rf-sage);
  color: var(--rf-ink);
  border-color: var(--rf-line);
}
.game-shell .world-province-btn--selected {
  background: #d2e3da;
  border-color: #527970;
}

/* Light surfaces for the integrated atlas, community and security. */
.game-shell .atlas-layout > :is(section,aside),
.game-shell #security-root :is(.sec-intro,.sec-panel),
.game-shell #community-main :is(.c-intro,.c-panel) {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border: 1px solid var(--rf-line);
  border-radius: 10px;
  box-shadow: none;
}
.game-shell :is(.world-side,#security-root .sec-panel) {
  background: transparent;
  padding: 0;
  border: 0;
}
.game-shell .atlas-layout aside dl { background: var(--rf-sage); }
.game-shell .atlas-layout :is(button,input,select),
.game-shell #community-main :is(button,input,textarea,select,.c-tabs a) {
  background: var(--rf-sage);
  color: var(--rf-ink);
  border-color: var(--rf-line);
}
.game-shell #community-main {
  --bg: var(--rf-stone);
  --panel: var(--rf-paper);
  --panel-2: var(--rf-sage);
  --ink: var(--rf-ink);
  --muted: #52666a;
  --line: var(--rf-line);
  --line-soft: #d6ddd6;
  --accent: #386f73;
  --accent-ink: white;
  --danger: #a03d37;
  --warning: #835018;
  --info: #245f7a;
  color-scheme: light;
  color: var(--rf-ink);
  display: block;
  padding-top: 1rem;
}
.game-shell #community-main .c-tabs a[aria-current="page"] {
  color: white;
  background: #386f73;
}
.game-shell #community-main .c-intro,
.game-shell #security-root .sec-intro { padding: clamp(1rem, 2vw, 1.5rem); }
.game-shell #community-main .c-intro h1,
.game-shell #security-root :is(.sec-intro h1,.sec-score,.sec-status) { color: var(--rf-ink); }
.game-shell .world-viewport { background: #c6c3a7; }
.game-shell .world-relief { pointer-events: none; }
.game-shell .world-svg .world-province .world-shape {
  fill-opacity: .44;
  stroke: #eee4bb;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.game-shell .world-svg .world-province:is(:hover,:focus-visible,.world-province--selected) .world-shape {
  fill-opacity: .65;
  stroke: #ffdf91;
  stroke-width: 3;
}
.game-shell .world-svg .world-label { fill: #fff8df; stroke: #242b21; paint-order: stroke; }

.game-shell .game-hud > .rts-topbar__profile {
  --rts-edge: var(--rf-line);
  --rts-muted: #52666a;
  --rts-amber: #87521e;
  margin-inline-start: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}
.game-shell .game-hud > .rts-topbar__profile :is(.rts-iconbtn,.rts-menu) {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: var(--rf-line);
}
.game-shell .game-hud .rts-menu :is(.rts-menu__identity,.rts-menu__item) { color: var(--rf-ink); }
.game-shell:not([data-page="command"]) .game-hud > .rts-topbar__profile { display: none; }
.rts-camp .rts-theater-exit { position: absolute; bottom: 5.5rem; right: .75rem; z-index: 12; }

/* Settlement tools use the same paper, stone and sage palette as the game shell. */
.game-shell .settlement-view.rts-camp {
  --rts-edge: var(--rf-line);
  --rts-muted: #52666a;
  --rts-amber: #87521e;
  --rts-panel: var(--rf-paper);
  color: var(--rf-ink);
  background: var(--rf-stone);
}
.game-shell .rts-camp :is(.rts-topbar,.rts-rail,.rts-contextstrip,.rts-camera-controls) {
  color: var(--rf-ink);
  background: var(--rf-sage);
  border-color: var(--rf-line);
}
.game-shell .rts-camp :is(.rts-panel,.rts-modal,.rts-modal__body,.rts-menu,.rts-fact) {
  color: var(--rf-ink);
  background: var(--rf-paper);
  border-color: var(--rf-line);
}
.game-shell .rts-camp .rts-panel { border-radius: 8px; }
.game-shell .rts-camp .rts-modal { border-radius: 12px; }
.game-shell .rts-camp .rts-modal__body { padding: clamp(.85rem, 2vw, 1.2rem); gap: .65rem; }
.game-shell .rts-camp :is(.rts-line,.rts-stepcount,.rts-menu__identity,.rts-menu__item) { color: var(--rf-ink); }
.game-shell .rts-camp :is(.rts-reqs,.rts-link,.rts-line--important) { color: #754921; }
.game-shell .rts-camp :is(.rts-iconbtn,.rts-button,.rts-strip__btn,.rts-stepbtn,.rts-tab,.rts-chip,.rts-camera-control) {
  color: var(--rf-ink);
  background: var(--rf-paper);
  border-color: var(--rf-line);
  border-radius: 6px;
}
.game-shell .rts-camp :is(.rts-button--primary,.rts-strip__btn--primary,.rts-tab[aria-selected="true"]) {
  color: #fff;
  background: #386f73;
  border-color: #386f73;
}
.game-shell .rts-camp :is(.rts-iconbtn,.rts-button,.rts-strip__btn,.rts-stepbtn,.rts-tab,.rts-camera-control):hover:not(:disabled) {
  outline: 1px solid #548f8e;
  outline-offset: -1px;
}
.game-shell .rts-building-summary {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .65rem;
  background: var(--rf-sage);
  border: 1px solid var(--rf-line);
  border-radius: 8px;
}
.game-shell .rts-building-summary__facts { display: grid; gap: .3rem; min-width: 0; }
.game-shell .rts-building-summary .rts-building-portrait {
  flex: 0 0 clamp(64px, 20%, 96px);
  width: auto;
  margin: 0;
  background: var(--rf-paper);
  border-color: var(--rf-line);
  border-radius: 6px;
}

.game-shell .rts-camp-info { display: flex; align-items: center; gap: .25rem; }
.game-shell:not([data-page="command"]) .game-hud > .rts-camp-info { display: none; }
.game-shell .rts-camp-info :is(summary,.rts-iconbtn) {
  display: grid; place-items: center; width: 44px; min-height: 44px;
  color: var(--rf-teal); background: var(--rf-paper); border: 1px solid var(--rf-line);
  border-radius: 6px; cursor: pointer; list-style: none;
}
.rts-info-disclosure { position: relative; }
.rts-info-disclosure summary::-webkit-details-marker { display: none; }
.rts-info-disclosure > .rts-panel {
  display: none; position: absolute; inset-inline-end: 0; top: 100%; z-index: 80;
  width: min(20rem, calc(100vw - 1rem)); max-height: 55vh; overflow: auto;
  background: var(--rf-paper); color: var(--rf-ink); border: 1px solid var(--rf-line);
  border-radius: 8px; box-shadow: 0 8px 24px #24343a30;
  --rts-edge: var(--rf-line); --rts-muted: #52666a; --rts-amber: #87521e;
}
.rts-info-disclosure:is([open],:focus-within) > .rts-panel { display: block; }
@media (hover: hover) {
  .rts-info-disclosure:hover > .rts-panel { display: block; }
}
.game-hud .rts-info-disclosure :is(.rts-line,.rts-weather-name,.rts-effects) { color: var(--rf-ink); }
.game-hud .rts-info-disclosure :is(.rts-button,.rts-link) { color: var(--rf-teal); }
.rts-global-chat {
  display: grid; grid-template-rows: auto auto minmax(0,1fr) auto auto;
  min-height: 0; flex: 1; background: var(--rf-paper); color: var(--rf-ink);
  border: 1px solid var(--rf-line); border-radius: 8px; overflow: hidden;
}
.rts-global-chat [data-chat-status] { margin: 0; padding: .4rem .65rem; font-size: .75rem; }
.rts-global-chat [data-chat-status]:empty { padding: 0; }
.rts-global-chat [data-chat-log] { overflow: auto; padding: .55rem; list-style: none; }
.rts-chat-message { padding: .45rem .55rem; border-bottom: 1px solid var(--rf-line); }
.rts-chat-message p { white-space: pre-wrap; overflow-wrap: anywhere; }
.rts-chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .72rem; color: #52666a; }
.rts-chat-action { margin-inline-start: auto; min-height: 32px; color: var(--rf-teal); background: transparent; border: 0; }
.rts-global-chat form { display: grid; gap: .35rem; padding: .65rem; border-top: 1px solid var(--rf-line); }
.rts-global-chat textarea { width: 100%; min-width: 0; resize: vertical; color: var(--rf-ink); background: var(--rf-paper); border: 1px solid var(--rf-line); }
.rts-global-chat .rts-chat-close { display: none; }
@media (max-width: 900px) {
  .rts-info-disclosure > .rts-panel { position: fixed; inset: var(--game-header-height, 100px) .5rem auto auto; }
  .game-shell .rts-camp.rts-chat-open .rts-rail {
    display: flex; position: absolute; z-index: 25; inset: 0 0 0 auto; width: min(100%, 25rem);
  }
  .rts-global-chat .rts-chat-close { display: grid; }
}

.rts-global-chat .rts-panel__head { padding: .7rem .8rem; background: #e3e8e2; }
.rts-global-chat .rts-panel__head h2 { font-size: .95rem; color: var(--rf-ink); }
.rts-chat-kicker { display: block; color: #52666a; font-size: .6rem; letter-spacing: .13em; }
.rts-global-chat [data-chat-log] { background: var(--rf-stone); }
.rts-global-chat .rts-chat-message { display: flex; align-items: flex-start; gap: .4rem; padding: .28rem 0; border: 0; }
.rts-chat-avatar {
  display: grid; place-items: center; flex: 0 0 1.8rem; height: 1.8rem;
  border-radius: 50%; background: #386f73; color: white; font-weight: 700;
}
.rts-chat-bubble {
  min-width: 0; padding: .32rem .52rem .5rem; border: 1px solid var(--rf-line);
  border-radius: 3px 10px 10px; background: var(--rf-paper);
}
.rts-chat-message[data-own="true"] { flex-direction: row-reverse; }
.rts-chat-message[data-own="true"] .rts-chat-bubble { background: #dce9df; border-radius: 10px 3px 10px 10px; }
.rts-chat-meta strong { color: #234f52; overflow-wrap: anywhere; }
.rts-chat-action { font-size: .68rem; cursor: pointer; }
.rts-chat-composer-tools { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rts-chat-emojis { position: relative; }
.rts-chat-emojis summary, .rts-chat-emojis button {
  display: grid; place-items: center; min-width: 44px; min-height: 44px;
  border: 1px solid var(--rf-line); border-radius: 6px; background: var(--rf-paper);
  font-size: 1.2rem; cursor: pointer; list-style: none;
}
.rts-chat-emojis summary::-webkit-details-marker { display: none; }
.rts-chat-emojis[open] [data-chat-emoji-grid] {
  display: grid; grid-template-columns: repeat(4, 44px); gap: .2rem; padding: .4rem;
  position: absolute; inset: auto auto calc(100% + .35rem) 0; z-index: 2;
  border: 1px solid var(--rf-line); border-radius: 8px;
  background: var(--rf-paper); box-shadow: 0 6px 24px #24343a30;
}
.rts-chat-emojis button:hover { background: var(--rf-sage); }

/* Single set of camp status controls beside the scene. */
.game-shell .rts-camp .rts-hud {
  inset: .45rem auto auto .45rem;
  width: max-content;
  max-width: calc(100% - .9rem);
  padding: 0;
}
.game-shell .rts-camp .rts-hud__status {
  display: grid;
  gap: .25rem;
  justify-items: start;
  overflow: visible;
  pointer-events: none;
}
.game-shell .rts-camp .rts-hudchip--bell { position: relative; inset: auto; margin: 0; }
@media (min-width: 769px) {
  .game-shell .rts-camp .rts-hudchip .rts-tip { inset: 0 auto auto calc(100% + .35rem); }
}
@media (max-width: 768px) {
  .game-shell .rts-camp .rts-hudchip { padding-inline: .35rem; }
  .game-shell .rts-camp .rts-hudchip__band { display: none; }
}

.game-shell .rts-camp .rts-topbar > .rts-hud {
  position: static;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.game-shell .rts-camp .rts-topbar__camp { flex: 0 0 auto; }
.game-shell .rts-camp .rts-topbar .rts-hud__status {
  display: flex;
  flex-wrap: wrap;
}
.game-shell .rts-camp .rts-topbar .rts-hudchip .rts-tip {
  inset: calc(100% + .35rem) auto auto 0;
}
.game-shell .rts-camp .rts-topbar { flex-wrap: wrap; gap: .3rem .65rem; padding-block: .25rem; }
.game-shell .rts-camp .rts-app { grid-template-rows: auto minmax(0,1fr) 84px; }
@media (max-width: 768px) {
  .game-shell .rts-camp .rts-app { grid-template-rows: auto minmax(0,1fr) 64px; }
  .game-shell .rts-camp .rts-topbar > .rts-hud { order: 2; flex-basis: 100%; width: 100%; }
  .game-shell .rts-camp .rts-topbar .rts-hudchip .rts-tip {
    inset: auto .5rem calc(64px + env(safe-area-inset-bottom) + .4rem);
  }
}

.game-shell .rts-camp .rts-notifylist { gap: .55rem; }
.game-shell .rts-camp .rts-notify {
  gap: .35rem; padding: .7rem .8rem; color: var(--rf-ink);
  background: var(--rf-paper); border: 1px solid var(--rf-line); border-radius: 8px;
}
.game-shell .rts-camp .rts-notify--important { border-inline-start: 3px solid #a75e27; }
.rts-notify__heading { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.game-shell .rts-camp :is(.rts-notify__title,.rts-notify__body) { color: var(--rf-ink); }
.game-shell .rts-camp .rts-notify .rts-important {
  width: fit-content; background: #f1e6d4; color: #754921; border-color: #d5b48d;
}
.rts-notify__open { justify-self: start; text-decoration: none; margin-top: .15rem; }

/* Settlement commands share the paper palette of the game shell. */
.game-shell .rts-camp :is(.rts-brow,.rts-cmd-card,.rts-world__detail) {
  background: var(--rf-paper);
  border-color: var(--rf-line);
  color: var(--rf-ink);
  border-radius: 8px;
}
.game-shell .rts-camp :is(.rts-brow,.rts-cmd-card) { padding: .8rem; }
.game-shell .rts-camp :is(.rts-command-tabs,.rts-world__map) {
  background: var(--rf-sage);
  border-color: var(--rf-line);
}
.game-shell .rts-camp .rts-command-tab { color: var(--rf-ink); }
.game-shell .rts-camp .rts-command-tab[aria-selected="true"],
.game-shell .rts-camp .rts-chip[aria-pressed="true"] {
  background: var(--rf-teal);
  border-color: var(--rf-teal);
  color: white;
}
.game-shell .rts-camp :is(.rts-brow__name,.rts-cmd-card h3,.rts-cmd-rowtext strong,.rts-cmd-fact strong,.rts-world__detail h3,.rts-world__fact strong) {
  color: var(--rf-ink);
}
.game-shell .rts-camp :is(.rts-cmd-rowtext span,.rts-cmd-rowtext small,.rts-cmd-fact,.rts-world__sub,.rts-world__legend,.rts-world__fact,.rts-disclosure) {
  color: #485d60;
}
.game-shell .rts-camp .rts-cmd-row { border-color: var(--rf-line); }
.game-shell .rts-camp .rts-cmd-fact strong { text-align: end; }
.game-shell .rts-camp .rts-disclosure summary {
  color: var(--rf-teal);
  cursor: pointer;
  font-weight: 650;
  padding-block: .4rem;
}
.game-shell .rts-camp .rts-disclosure ul { margin: .25rem 0; padding-inline-start: 1.2rem; }
.game-shell .rts-camp .rts-world__svg { background: var(--rf-sage); }
@media (max-width: 600px) {
  .game-shell .rts-camp .rts-command-tab { min-height: 44px; flex: 0 0 auto; }
  .game-shell .rts-camp .rts-cmd-row { flex-wrap: wrap; }
  .game-shell .rts-camp .rts-cmd-row .rts-button { min-height: 44px; min-width: 44px; }
}

.game-shell .rts-camp .rts-population-stats,
.game-shell .rts-camp .rts-population-meters,
.game-shell .rts-camp .rts-population-profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: .5rem;
  margin: .65rem 0;
}
.game-shell .rts-camp .rts-population-stat,
.game-shell .rts-camp .rts-population-meter,
.game-shell .rts-camp .rts-population-profile {
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid var(--rf-line);
  border-radius: 7px;
  background: var(--rf-sage);
  color: var(--rf-ink);
  overflow-wrap: anywhere;
}
.game-shell .rts-camp .rts-population-stat dt,
.game-shell .rts-camp .rts-population-meter p {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .76rem;
  margin: 0;
}
.game-shell .rts-camp .rts-population-stat dd {
  margin: .2rem 0 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.game-shell .rts-camp .rts-population-meter meter {
  display: block;
  width: 100%;
  height: .8rem;
}
.game-shell .rts-camp .rts-population-meter strong { margin-inline-start: auto; }
.game-shell .rts-camp .rts-population-profiles {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  align-items: start;
}
.game-shell .rts-camp .rts-population-profile[open] { grid-column: 1 / -1; }
.game-shell .rts-camp .rts-population-profile summary {
  min-height: 44px;
  cursor: pointer;
}
.game-shell .rts-camp .rts-population-profile summary small {
  display: block;
  margin: .2rem 0 0 1rem;
}
.game-shell .rts-camp .rts-population-events,
.game-shell .rts-camp .rts-population-relationships {
  margin: .4rem 0;
  padding-inline-start: 1rem;
}
.game-shell .rts-camp .rts-population-events li {
  padding: .35rem 0;
  border-bottom: 1px solid var(--rf-line);
}
.game-shell .rts-camp .rts-population-events p { margin: .2rem 0; }

.game-shell .rts-camp .rts-employment-policies {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-block: .55rem;
}
.game-shell .rts-camp .rts-employment-policies button {
  min-block-size: 2.75rem;
}
.game-shell .rts-camp .rts-employment-policies button[aria-pressed="true"] {
  background: var(--game-surface-muted, #dce7df);
  border-color: var(--game-accent, #2e625d);
  color: var(--game-ink, #1b342f);
  font-weight: 700;
}

/* Keep progression stages and the mission rail on the game shell palette. */
.game-shell .dev-shell .dev-stage-group {
  background: var(--rf-stone);
  color: var(--rf-ink);
}
.game-shell .dev-shell .dev-stage-group + .dev-stage-group {
  border-top: 1px solid var(--rf-line);
}
.game-shell .exp-view .exp-listcol {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.game-shell .exp-view .exp-list {
  scrollbar-color: #78928a var(--rf-sage);
}

/* Weather text on the light settlement surfaces. */
.game-shell :is([data-rts-context], [data-rts-panel="weather"]) :is(.rts-weather-name, .rts-effects) {
  color: var(--rf-ink);
}

/* Expedition dialogs and filters share the light game palette. */
.game-shell .exp-view :is(.exp-brief, .exp-confirm) {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: var(--rf-line);
}
.game-shell .exp-view :is(.exp-brief__head, .exp-fact, .exp-weights, .exp-narrative) {
  background: var(--rf-sage);
}
.game-shell .exp-view :is(.exp-fact__value, .exp-weights summary, .exp-weight, .exp-narrative, .exp-confirm__text) {
  color: var(--rf-ink);
}
.game-shell .exp-view .exp-risk__head strong { color: var(--exp-amber); }
.game-shell .exp-view .exp-risk__meter { accent-color: var(--rf-teal); }
.game-shell .exp-view .exp-button--primary {
  background: var(--rf-teal);
  border-color: var(--rf-teal);
  color: white;
}
.game-shell .exp-view .exp-type-disclosure {
  margin: .25rem .55rem;
  border: 1px solid var(--rf-line);
  border-radius: .4rem;
  background: var(--rf-paper);
}
.game-shell .exp-view .exp-type-disclosure > summary {
  padding: .65rem;
  min-height: 44px;
  color: var(--rf-ink);
  cursor: pointer;
}
.game-shell .exp-view .exp-filters:not(.exp-filters--types) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.game-shell .exp-view .exp-filter { border-radius: .4rem; }

.game-shell .dev-shell .dev-detail .dev-reasons {
  background: var(--rf-sage) !important;
  color: var(--rf-ink) !important;
}
.game-shell .dev-shell .dev-detail .dev-reasons .dev-missing-title {
  color: var(--rf-ink);
}

.game-shell .exp-view .exp-difficulties {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
}
.game-shell .exp-view .exp-difficulties h4 { grid-column: 1 / -1; }
.game-shell .exp-view .exp-difficulties button {
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: .4rem;
}
.game-shell .exp-view .exp-difficulties button:disabled {
  opacity: .65;
  cursor: not-allowed;
}
.waz-language { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .5rem; font-size: .75rem; }
.waz-language select { min-height: 44px; max-width: 130px; padding: .45rem; font: inherit; color: #24383c; background: #f8f7f0; border: 1px solid #b8c9c1; border-radius: .4rem; }
.waz-language select:focus-visible { outline: 2px solid #a66b23; outline-offset: 2px; }
@media(max-width:900px) { .waz-language > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
/* Keep Security containers and confirmations in the shared Reclaimed Future palette. */
.game-shell #security-root :is(.sec-command-center,.sec-negotiation) {
  background: var(--rf-sage);
  color: var(--rf-ink);
  border-color: var(--rf-line);
}
.game-shell #security-root dialog.sec-confirm {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: #81511c;
}
.game-shell #security-root .sec-confirm__title { color: #81511c; }

/* Semantic status ink must remain readable on the shared ivory surfaces. */
.game-shell .exp-view :is(.exp-pill--available,.exp-legend--available) { color: #286752; }
.game-shell .exp-view :is(.exp-pill--cooldown,.exp-legend--cooldown) { color: #81511c; }
.game-shell .exp-view :is(.exp-pill--traveling,.exp-legend--traveling) { color: #294b4e; }
.game-shell .exp-view :is(.exp-pill--blocked,.exp-legend--blocked) { color: #943e36; }
.game-shell .world-app .world-pill { color: #81511c; }
.game-shell .world-app .world-pill--ok { color: #286752; }
.game-shell #security-root :is(.sec-band-label--calm,.sec-band-label--uneasy) { color: #286752; }
.game-shell #security-root :is(.sec-band-label--threatened,.sec-band-label--critical) { color: #81511c; }
.game-shell #security-root .sec-band-label--siege { color: #943e36; }
.game-shell #security-root .sec-band-label--unknown { color: #294b4e; }


/* Shared UI surfaces. Terrain, illustrations and their overlays keep their own colors. */
.game-shell :is(.page-access-note,.page-location,#page-content > .research-panel) {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: var(--rf-line);
}
.game-shell :is(.page-access-note,.page-location,#page-content > .research-panel,.atlas-layout aside) :is(p,dt,small) { color: var(--rf-muted); }
.game-shell :is(.page-access-note,.page-location,.atlas-layout aside) a { color: var(--rf-link); }
.game-shell :is(.game-boot,.atlas-layout .live-stamp) { color: var(--rf-muted); }
.game-shell .atlas-layout aside dd { color: var(--rf-ink); }

.game-shell #community-main {
  --muted: var(--rf-muted);
  --danger: var(--rf-danger);
  --warning: var(--rf-warning);
}
.game-shell #community-main .c-intro h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-block-end: .55rem;
}
.game-shell #community-main #panel-thread { padding: clamp(1rem, 2.3vw, 1.75rem); }
.game-shell #community-main .c-thread-back { margin: 0 0 .9rem; }
.game-shell #community-main .c-thread-title { margin: .45rem 0 .65rem; font-size: clamp(1.45rem, 3vw, 2.2rem); }
.game-shell #community-main .c-post-byline { padding-block: .45rem; border-bottom: 1px solid var(--rf-line); }
.game-shell #community-main .c-markdown,
.game-shell #community-main .c-markdown :is(p,ul,ol,li,blockquote,code,strong,em,h3,h4) {
  color: var(--rf-ink);
}
.game-shell #community-main .c-markdown { max-inline-size: 78ch; margin-block: 1rem; }
.game-shell #community-main :is(.c-markdown a,.c-back,.c-notification__link) { color: var(--rf-link); }
.game-shell #community-main .c-moderation {
  background: var(--rf-sage);
  color: var(--rf-ink);
  border: 1px solid var(--rf-line);
  border-inline-start: 3px solid var(--rf-teal);
  padding: 1rem;
}
.game-shell #community-main .c-moderation > h3 { margin: 0 0 .65rem; color: var(--rf-ink); }
.game-shell #community-main .c-moderation__actions { margin-bottom: 0; }
.game-shell #community-main button.c-primary { background: var(--rf-teal); color: white; border-color: var(--rf-teal); }
.game-shell #community-main button.c-danger { background: #f6e8e3; color: var(--rf-danger); border-color: #b8746d; }
.game-shell #community-main button:disabled { opacity: 1; color: var(--rf-muted); background: var(--rf-sage); }
.game-shell #community-main .c-badge { background: var(--rf-danger); color: white; }
.game-shell #community-main .c-tabs a[aria-current="page"] .c-badge { background: var(--rf-paper); color: var(--rf-danger); }

.game-shell #command:has(.auth-entry) {
  background: var(--rf-paper);
  color: var(--rf-ink);
  border-color: var(--rf-line);
}
.game-shell #command:has(.auth-entry) :is(.entry-lede,.auth-help) { color: var(--rf-muted); }
.game-shell #command:has(.auth-entry) a { color: var(--rf-link); }
.game-shell #command:has(.auth-entry) .eyebrow { color: var(--rf-warning) !important; }

@media (max-width: 900px) {
  .game-shell .game-header { padding: .25rem max(.5rem, env(safe-area-inset-left)); }
  .game-shell .game-header > nav {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    gap: .25rem;
  }
  .game-shell .game-header > nav > .game-home {
    justify-content: center;
    margin: 0;
    padding: 0;
    font-size: 0;
  }
  .game-shell .game-header > nav > a[href="/settlement"] {
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
    font-size: .75rem;
    padding-inline: .4rem;
  }
  .game-shell .game-directory { position: static; margin-inline-start: 0; }
  .game-shell .game-directory summary { min-width: 44px; justify-content: center; padding-inline: .35rem; font-size: 0; }
  .game-shell .game-directory summary::after { content: '☰'; font-size: 1.1rem; }
  .game-shell .game-directory > div {
    width: min(18rem, calc(100vw - 1.25rem));
    max-height: min(64dvh, 28rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .game-shell .game-hud:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: .25rem 0;
  }
  .game-shell .game-hud > [data-game-resources] { grid-column: 1 / 3; }
  .game-shell .game-hud > [data-game-inventory] { grid-column: 3; }
  .game-shell .game-hud:not(.inventory-open) [data-game-resources] {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .game-shell .game-resource { flex: none; }
  .game-shell .game-hud > time { grid-column: 1; font-size: .7rem; }
  .game-shell .game-hud > .game-account-tools { grid-column: 2 / 4; justify-self: end; }
  .game-shell .game-hud > .rts-topbar__profile { grid-column: 2; flex-wrap: nowrap; }
  .game-shell .game-hud > .rts-camp-info { grid-column: 3; justify-self: end; }
  .game-shell .dev-heading h2 { overflow-wrap: anywhere; }
}

.game-shell .rts-chat-bubble > p { color: var(--rf-ink); }
@media (hover: none) {
  .game-shell .rts-hudchip--bell .rts-tip { display: none !important; }
}
@media (max-width: 900px) {
  .game-shell .game-hud.inventory-open [data-game-resources] {
    max-height: min(6.2rem, 23dvh);
    overflow-y: auto;
    align-content: start;
    overscroll-behavior: contain;
  }
}

/* Shared resource artwork for the HUD, exchange and rewards. */
.waz-resource-value { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.waz-resource-list { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; }
.waz-resource-icon { display: inline-grid; place-items: center; flex: none; vertical-align: middle; color: var(--resource-ink, #356164); }
.game-shell .waz-resource-icon svg { display: block; background: transparent; border: 0; padding: 0; }
.mv-segment-btn > .waz-resource-icon, .mv-btn > .waz-resource-icon { margin-inline-end: .35rem; }
.mv-resource .mv-resource-name { font-weight: 700; letter-spacing: .045em; }
.mv-resource .mv-resource-name .waz-resource-icon {
  width: 30px; height: 30px; border-radius: 7px;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
:is(.game-resource,.waz-resource-icon)[data-resource="credits"] { --resource-ink: #925408; }
:is(.game-resource,.waz-resource-icon)[data-resource="food"] { --resource-ink: #4b6933; }
:is(.game-resource,.waz-resource-icon)[data-resource="water"] { --resource-ink: #246487; }
:is(.game-resource,.waz-resource-icon)[data-resource="energy"] { --resource-ink: #9a5610; }
:is(.game-resource,.waz-resource-icon)[data-resource="materials"] { --resource-ink: #994d34; }
:is(.game-resource,.waz-resource-icon)[data-resource="technology"] { --resource-ink: #674b96; }
:is(.game-resource,.waz-resource-icon)[data-resource="wood"] { --resource-ink: #805735; }
:is(.game-resource,.waz-resource-icon)[data-resource="stone"] { --resource-ink: #5e656d; }
:is(.game-resource,.waz-resource-icon)[data-resource="metal"] { --resource-ink: #376873; }
:is(.game-resource,.waz-resource-icon)[data-resource="fuel"] { --resource-ink: #6a6a29; }
:is(.game-resource,.waz-resource-icon)[data-resource="steel"] { --resource-ink: #4f6684; }
:is(.game-resource,.waz-resource-icon)[data-resource="parts"] { --resource-ink: #665b79; }
.game-shell .game-resource[data-resource] svg { color: var(--resource-ink); }
.rts-population-meter progress { display: block; width: 100%; accent-color: var(--rf-teal); }

/* Group related commands without expanding the global header. */
.game-shell .game-header nav a[hidden]{display:none!important}
.game-shell [data-related-sections]{display:flex;flex-wrap:wrap;gap:.5rem}
.game-shell [data-related-sections]:empty{display:none}
.game-shell [data-related-sections] a{display:inline-flex;align-items:center;min-height:44px;padding:.4rem .7rem;border:1px solid #57758b;border-radius:5px;color:#a6ddff}
.game-directory>div{z-index:160;max-height:70vh;overflow-y:auto}

@media(max-width:900px){
 .game-shell .game-hud>time{grid-row:2;grid-column:1}
 .game-shell .game-hud>.rts-camp-info{grid-row:2;grid-column:2;justify-self:end}
 .game-shell .game-hud>.rts-topbar__profile{grid-row:2;grid-column:3;justify-self:end}
 .game-shell .game-hud [data-rts-world]{display:none}
}
/* Compact game directory and explicit resource amounts. */
body.game-shell .game-header nav .game-directory summary{display:flex;gap:7px;align-items:center;justify-content:center;min-height:38px;padding:7px 11px;font-size:12px;border:1px solid #64859b70;border-radius:20px;background:#17324780;color:#cce6f5;list-style:none;line-height:1}
body.game-shell .game-header nav .game-directory summary::-webkit-details-marker{display:none}
body.game-shell .game-header nav .game-directory summary::after{content:none}
body.game-shell .game-header nav .game-directory summary svg{width:17px;height:17px;flex:none;background:none;border:0}
body.game-shell .game-header nav .game-directory[open] summary{background:#a5d5ea;color:#102a3c;border-color:#a5d5ea}
body.game-shell .game-header nav .game-directory>div{display:grid;grid-template-columns:repeat(2,minmax(140px,1fr));gap:5px;padding:12px;width:360px;max-width:calc(100vw - 24px);border:1px solid #64859b;border-radius:14px;background:#0d2234f5;box-shadow:0 18px 50px #0007;backdrop-filter:blur(16px)}
body.game-shell .game-header nav .game-directory:not([open])>div{display:none}
body.game-shell .game-header nav .game-directory>div a{display:flex;align-items:center;gap:9px;min-height:44px;padding:9px;border-radius:8px;color:#cde7f6;font-size:12px;white-space:normal}
body.game-shell .game-header nav .game-directory>div a:hover{background:#25485d}
body.game-shell .game-header nav .game-directory>div a[hidden]{display:none!important}
body.game-shell .game-resource[data-resource]{cursor:pointer}body.game-shell .game-resource[data-resource]:focus-visible{outline:2px solid #eac68b;outline-offset:2px}
.resource-detail-dialog{max-width:min(440px,calc(100vw - 28px));padding:26px;border:1px solid #799bad;border-radius:14px;background:#10283b;color:#e7f2fa;box-shadow:0 20px 80px #0008;font-family:system-ui,sans-serif}.resource-detail-dialog::backdrop{background:#0009}.resource-detail-dialog h2{font-size:22px}.resource-detail-dialog p{line-height:1.7}.resource-detail-dialog button{min-height:44px;padding:8px 20px;border:1px solid #9acfe5;border-radius:8px;background:#9acfe5;color:#142a3b}
@media(max-width:900px){body.game-shell .game-header nav .game-directory summary{width:44px;height:44px;padding:10px}body.game-shell .game-header nav .game-directory summary>span{display:none}body.game-shell .game-header nav .game-directory summary svg{width:20px;height:20px}body.game-shell .game-header nav .game-directory>div{inset-inline-end:8px;max-height:70dvh}}
body.game-shell:has(.game-directory[open]) .game-header{z-index:200!important}
body.game-shell .game-header nav .game-directory>div{background:#0d2234}
body.game-shell .game-header nav{position:relative;z-index:2}
body.game-shell .game-header nav .game-directory>div{background:#0d2234!important;color:#cde7f6!important}
@media(max-width:900px){body.game-shell .game-hud>[data-game-inventory]{font-size:0!important;min-width:44px;width:44px;max-width:44px;justify-content:center;padding:8px!important}body.game-shell .game-hud>[data-game-inventory]::after{content:'•••';font-size:17px;letter-spacing:1px}}
@media(max-width:900px){body.game-shell .game-hud:not([hidden]){grid-template-columns:minmax(0,1fr) 44px 44px!important}body.game-shell .game-hud>[data-game-resources]{grid-row:1!important;grid-column:1!important}body.game-shell .game-hud>[data-game-inventory]{grid-row:1!important;grid-column:2!important}body.game-shell .game-hud>.game-audio-trigger{grid-row:1!important;grid-column:3!important}body.game-shell .game-hud.inventory-open>[data-game-resources]{grid-row:3!important;grid-column:1/-1!important}}
@media(max-width:900px){body.game-shell .game-hud>.game-account-tools{grid-row:2!important;grid-column:1/-1!important;justify-self:end;min-width:0;max-width:calc(100% - 95px)}body.game-shell .game-hud>.game-account-tools>*{min-width:0}}
