/* The original seven destinations have their own insignia and working masthead. */
.rail #navigation .rail-link {
  --nav-accent: #d6bd82;
  --nav-base: #1c1e1a;
  --nav-selected: #373426;
  --nav-icon: #2c2c21;
  min-height: 66px;
  padding: 10px 12px;
  gap: 9px;
  background: var(--nav-base);
  color: #dedbd1;
  border-left-color: #45483e;
  box-shadow: inset 0 1px 0 #ffffff06;
}
.rail #navigation .rail-link > svg {
  width: 32px;
  height: 32px;
  padding: 6px;
  color: var(--nav-accent);
  background: var(--nav-icon);
  border: 1px solid var(--nav-accent);
}
.rail #navigation .rail-link small { font-size: 12px; letter-spacing: .04em; }
.rail #navigation .rail-link.active {
  background: var(--nav-selected);
  color: #fff7e4;
  border-bottom-color: var(--nav-accent);
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--nav-accent) 28%, transparent);
}
.rail #navigation .rail-link.active > svg { background-color: var(--nav-selected); filter: brightness(1.2); }
.rail #navigation .rail-link:not(.active):hover { background: color-mix(in srgb, var(--nav-selected) 60%, var(--nav-base)); color: var(--nav-accent); border-bottom-color: transparent; }
.rail #navigation .rail-link:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: -5px; }

/* Radar rings, habitation badge, personnel file, compass, machine plate, awning, token. */
.rail #navigation [data-view="command"] { --nav-accent: #e1c684; --nav-base: #22231b; --nav-selected: #403b27; --nav-icon: #323023; }
.rail #navigation [data-view="command"] > svg { border-radius: 50%; background-image: repeating-radial-gradient(circle, transparent 0 5px, #dfc47b1c 6px 7px); }
.rail #navigation [data-view="colony"] { --nav-accent: #b3cf9e; --nav-base: #1b251e; --nav-selected: #34432c; --nav-icon: #29392a; }
.rail #navigation [data-view="colony"] > svg { clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); }
.rail #navigation [data-view="roster"] { --nav-accent: #a8cadf; --nav-base: #1b232a; --nav-selected: #2c3c49; --nav-icon: #25333e; }
.rail #navigation [data-view="roster"] > svg { border-radius: 2px 9px 2px 2px; border-left-width: 3px; background-image: linear-gradient(0deg, #a8cadf14 0 3px, transparent 3px); }
.rail #navigation [data-view="expeditions"] { --nav-accent: #e1b38b; --nav-base: #29221e; --nav-selected: #49372a; --nav-icon: #3c2e26; }
.rail #navigation [data-view="expeditions"] > svg { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background-image: linear-gradient(45deg, transparent 48%, #e1b38b22 49% 51%, transparent 52%); }
.rail #navigation [data-view="warehouse"] { --nav-accent: #c2cbd0; --nav-base: #24282b; --nav-selected: #3b454b; --nav-icon: #323a3e; }
.rail #navigation [data-view="warehouse"] > svg { clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%); background-image: repeating-linear-gradient(135deg, transparent 0 5px, #c2cbd010 6px 7px); }
.rail #navigation [data-view="market"] { --nav-accent: #e2c17c; --nav-base: #2a251c; --nav-selected: #4b3e27; --nav-icon: #3b3222; }
.rail #navigation [data-view="market"] > svg { border-radius: 5px 5px 1px 1px; border-top-width: 4px; background-image: repeating-linear-gradient(90deg, transparent 0 6px, #e2c17c15 7px 10px); }
.rail #navigation [data-view="launch"] { --nav-accent: #98d1d3; --nav-base: #19282b; --nav-selected: #28464a; --nav-icon: #203c41; }
.rail #navigation [data-view="launch"] > svg { clip-path: polygon(18% 0, 100% 0, 100% 82%, 82% 100%, 0 100%, 0 18%); border-style: double; border-width: 3px; padding: 4px; }
.rail-bottom [data-view="log"].active { background: #342b25; color: #e1c4a2; border-bottom-color: #c29c71; }

/* Each opened section recomposes existing game art; no text or controls are replaced. */
body {
  --route-accent: #d6bd82;
  --route-header-height: 160px;
  --route-wordmark-top: 24px;
  --route-header-ground: #1a1e1a;
  --route-scene: linear-gradient(90deg, #191d19 0 28%, #191d19a8 65%, #191d1940), url('./assets/environments/station-colony.webp') center 45% / cover;
  --route-art: url('./assets/facilities/relay-tower.webp') 75% center / auto 100% no-repeat;
  --route-art-inset: 4px 6% 48px 47%;
}
body:has(#command-view:not([hidden])) {
  --route-accent: #ddc283;
  --route-header-height: 160px;
  --route-wordmark-top: 18px;
  --route-scene: repeating-radial-gradient(circle at 79% 49%, transparent 0 21px, #d0b87819 22px 23px, transparent 24px 45px), linear-gradient(90deg, #1a201b 0 36%, #1a201ba8), url('./assets/environments/station-colony.webp') center 48% / cover;
  --route-art: url('./assets/facilities/relay-tower.webp') 76% center / auto 108% no-repeat;
  --route-art-inset: 0 8% 40px 52%;
}
body:has(:is(#colony-view, #production-view, #research-view):not([hidden])) {
  --route-accent: #b6cd9a;
  --route-header-height: 196px;
  --route-wordmark-top: 30px;
  --route-header-ground: #1a231d;
  --route-scene: linear-gradient(90deg, #17231d 0 28%, #17231d7a 67%, #17231d29), url('./assets/environments/station-colony.webp') center 39% / cover;
  --route-art: url('./assets/facilities/habitat.webp') right center / auto 122% no-repeat;
  --route-art-inset: 4px 3% 38px 53%;
}
body:has(:is(#roster-view, #development-view):not([hidden])) {
  --route-accent: #afc9df;
  --route-header-height: 210px;
  --route-wordmark-top: 35px;
  --route-header-ground: #1b242d;
  --route-scene: repeating-linear-gradient(90deg, transparent 0 119px, #b0c9e215 120px 121px), linear-gradient(90deg, #19232d, #263341);
  --route-art: url('./assets/characters/robot-heavy.webp') 0 center / auto 100% no-repeat, url('./assets/characters/robot-scout.webp') 52% center / auto 100% no-repeat, url('./assets/characters/robot-support.webp') 100% center / auto 100% no-repeat;
  --route-art-inset: 8px 4% 42px 45%;
}
body:has(:is(#expeditions-view, #frontier-view):not([hidden])) {
  --route-accent: #ddb28b;
  --route-header-height: 176px;
  --route-header-ground: #28221e;
  --route-scene: linear-gradient(110deg, #28231f 0 30%, #28231f9c 65%, #28231f33), url('./assets/environments/station-polar.webp') center 48% / cover;
  --route-art: url('./assets/facilities/hangar.webp') right center / auto 118% no-repeat;
  --route-art-inset: 2px 3% 34px 50%;
}
body:has(#warehouse-view:not([hidden])) {
  --route-accent: #c1cbd0;
  --route-header-height: 154px;
  --route-wordmark-top: 12px;
  --route-header-ground: #252a2e;
  --route-scene: repeating-linear-gradient(135deg, transparent 0 14px, #c2ccd00a 15px 16px), linear-gradient(90deg, #252b2f 0 32%, #252b2f9c 71%, #252b2f66), url('./assets/environments/station-relay.webp') center 47% / cover;
  --route-art: url('./assets/facilities/workshop.webp') 15% center / auto 108% no-repeat, url('./assets/facilities/fabricator.webp') right center / auto 108% no-repeat;
  --route-art-inset: 0 4% 32px 53%;
}
body:has(:is(#market-view, #network-view):not([hidden])) {
  --route-accent: #dfc17f;
  --route-header-height: 170px;
  --route-header-ground: #2b251b;
  --route-scene: linear-gradient(90deg, #2a241a 0 32%, #2a241a99 68%, #2a241a44), url('./assets/environments/station-colony.webp') center 65% / cover;
  --route-art: url('./assets/facilities/market.webp') 90% center / auto 126% no-repeat;
  --route-art-inset: -2px 2% 30px 52%;
}
body:has(#launch-view:not([hidden])) {
  --route-accent: #9ed3d4;
  --route-header-height: 156px;
  --route-wordmark-top: 14px;
  --route-header-ground: #16282d;
  --route-scene: repeating-linear-gradient(0deg, transparent 0 27px, #9ed3d40c 28px 29px), repeating-linear-gradient(90deg, transparent 0 27px, #9ed3d40c 28px 29px), linear-gradient(90deg, #16272c, #203b42);
  --route-art: url('./assets/facilities/research.webp') 12% center / auto 112% no-repeat, url('./assets/facilities/crystal-vein.webp') right center / auto 108% no-repeat;
  --route-art-inset: 0 4% 34px 53%;
}
body:has(#log-view:not([hidden])) {
  --route-accent: #cfad88;
  --route-header-height: 150px;
  --route-wordmark-top: 10px;
  --route-header-ground: #28241f;
  --route-scene: repeating-linear-gradient(0deg, transparent 0 31px, #ccb38d11 32px 33px), linear-gradient(90deg, #27241e, #383228);
  --route-art: url('./assets/facilities/relay-tower.webp') right center / auto 100% no-repeat;
  --route-art-inset: 0 9% 36px 59%;
}

.topbar {
  height: var(--route-header-height);
  min-height: 0;
  background: var(--route-header-ground);
  border-bottom: 2px solid color-mix(in srgb, var(--route-accent) 60%, #353b35);
}
.topbar::before { inset: 0; background: var(--route-scene); opacity: 1; filter: saturate(.65); }
.topbar::after { inset: var(--route-art-inset); background: var(--route-art); opacity: .85; filter: saturate(.75); }
.topbar .wordmark { margin-top: var(--route-wordmark-top); position: relative; z-index: 1; }
.topbar .wordmark strong { font-size: 42px; letter-spacing: .04em; line-height: 1.05; }
.topbar .wordmark strong > span { color: var(--route-accent); }
.topbar .wordmark-sub { margin-top: 7px; font-size: 13px; letter-spacing: .38em; color: #e4dfd1; }
.topbar .resources { bottom: 14px; z-index: 1; }
.topbar .topbar-end { bottom: 14px; z-index: 1; }
.topbar .resource strong { font-size: 19px; }
.topbar .arena-global-inbox { background-color: #171e1be6; }
.page-heading .title-star { color: var(--route-accent); }

@media (min-width: 701px) and (max-width: 1100px) {
  .topbar .wordmark strong { font-size: 36px; }
  .topbar .wordmark-sub { font-size: 12px; }
  .rail #navigation .rail-link { padding-inline: 8px; gap: 7px; }
  .rail #navigation .rail-link > svg { width: 30px; height: 30px; padding: 5px; }
  .rail #navigation [data-view="launch"] > svg { padding: 3px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .rail #navigation .rail-link { flex-direction: column; gap: 5px; min-height: 74px; padding: 8px 4px; }
  .rail #navigation .rail-link small { font-size: 11px; }
  .topbar .wordmark strong { font-size: 32px; }
  .topbar::after { opacity: .7; }
}
@media (max-width: 700px) {
  .rail #navigation .rail-link { min-height: 58px; gap: 5px; padding: 7px 4px; }
  .rail #navigation .rail-link small { font-size: 11px; letter-spacing: 0; }
  .rail #navigation .rail-link > svg { width: 27px; height: 27px; padding: 4px; }
  .rail #navigation [data-view="launch"] > svg { padding: 2px; }
  /* Preserve the existing normal-flow wordmark / notification / resource grid. */
  .topbar { height: auto; min-height: 180px; padding: 16px; gap: 12px; }
  .topbar .wordmark { margin-top: 0; min-width: 0; }
  .topbar .wordmark strong { font-size: 26px; line-height: 1.12; letter-spacing: .01em; }
  .topbar .wordmark-sub { margin-top: 8px; font-size: 11px; letter-spacing: .2em; }
  .topbar .resources { position: static; }
  .topbar .resource strong { font-size: 17px; }
  .topbar .topbar-end { position: static; }
  .topbar::after { inset: 6px 4px 44px 48%; opacity: .42; }
  .topbar::before { filter: saturate(.5); }
}
@media (max-width: 380px) {
  .rail #navigation .rail-link { gap: 4px; }
  .rail #navigation .rail-link > svg { width: 25px; height: 25px; padding: 3px; }
  .rail #navigation [data-view="expeditions"] > svg { padding: 4px; }
  .rail #navigation [data-view="launch"] > svg { padding: 1px; }
  .topbar .wordmark strong { font-size: 24px; }
}
