/* Stage one: the existing game, framed as a field station on an alien world. */
body {
  background: #302f27 url('./assets/outpost/rock-country.svg') center top / cover fixed;
}
.app-shell {
  display: flex;
  flex-direction: column;
  max-width: 1360px;
  margin: 30px auto;
  min-height: calc(100dvh - 60px);
  background: #17191b;
  border: 1px solid #555448;
  box-shadow: 0 12px 50px #0007;
}
.app-main { display: contents; }
.topbar {
  order: 1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 260px;
  padding: 0 32px;
  gap: 24px;
  background: #141618;
  border-bottom: 1px solid #47473f;
}
.topbar::before { content: ''; position: absolute; inset: 0; z-index: -2; background: url('./assets/environments/station-colony.webp') center 38% / cover; opacity: .19; filter: saturate(.35); }
.topbar::after { content: ''; position: absolute; inset: 10px 7% 56px 40%; z-index: -1; background: url('./assets/characters/robot-heavy.webp') 0 50% / auto 95% no-repeat, url('./assets/characters/robot-scout.webp') 52% 50% / auto 95% no-repeat, url('./assets/characters/robot-support.webp') 100% 50% / auto 95% no-repeat; }
.wordmark { align-self: flex-start; margin-top: 60px; }
.wordmark strong { font-size: 52px; letter-spacing: 2px; color: #f1eee3; text-shadow: 0 2px 8px #000b; }
.wordmark strong > span { color: #9e8a61; }
.wordmark-sub { margin-top: 9px; color: #ded3bb; font-size: 18px; letter-spacing: 9px; }
.resources { position: absolute; bottom: 20px; left: 32px; margin: 0; }
.resource strong { font-size: 21px; }
.topbar-end { position: absolute; right: 28px; bottom: 20px; margin-left: 0; padding-left: 22px; border-color: #45453c; }
.rail {
  order: 0;
  position: sticky;
  inset: auto;
  top: 0;
  width: 100%;
  height: auto;
  padding: 0;
  flex-direction: row;
  align-items: stretch;
  background: #111315;
  border: 0;
  border-bottom: 1px solid #58584b;
  z-index: 40;
}
.rail .brand-mark { display: grid; width: 52px; height: 58px; margin: 0; flex-shrink: 0; }
.rail .brand-mark svg { width: 23px; height: 23px; }
.rail-rule { display: none; }
.rail nav { display: flex; align-items: stretch; flex: 1; width: auto; min-width: 0; gap: 0; }
.rail .rail-link {
  display: flex;
  flex: 1;
  width: auto;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  gap: 8px;
  border: 0;
  border-left: 1px solid #373932;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: #c6c4b9;
  background: transparent;
}
.rail .rail-link small { font-size: 13px; white-space: nowrap; letter-spacing: 1px; }
.rail .rail-link svg { width: 18px; height: 18px; }
.rail .rail-link.active { color: #f2dfab; background: #292b27; border-bottom-color: #c1a16a; }
.rail .rail-link.active:before { display: none; }
.rail .rail-link:hover { color: #fff8e8; background: #2b2d29; }
.rail-bottom { display: flex; flex: 0 0 auto; width: auto; flex-direction: row; align-items: stretch; gap: 0; margin: 0; padding: 0; }
.rail-bottom .rail-link { flex: 0 0 auto; }
.rail .commander-avatar { align-self: center; margin: 0 10px; width: 30px; height: 32px; border-radius: 2px; }
main { order: 2; width: 100%; min-width: 0; padding: 28px 32px 0; }
.page-heading { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid #3c3e36; }
.page-heading h1 { font-size: 34px; font-weight: 600; letter-spacing: 2px; margin: 7px 0; }
.page-heading p { font-size: 13px; line-height: 1.8; }
.page-heading .eyebrow { font-size: 10px; letter-spacing: 2px; color: #baaa88; }
.workspace { grid-template-columns: minmax(0, 1fr) 292px; gap: 24px; }
.workspace > *, .view { min-width: 0; }
.world-panel { border: 1px solid #626456; }
.world-panel .panel-toolbar { min-height: 52px; height: auto; padding: 10px 16px; }
.world-panel .panel-toolbar h2 { font-size: 13px; letter-spacing: 1px; }
.world-panel .world-viewport { max-height: none; }
.world-panel .world-viewport #world { display: block; width: 100%; max-width: none; max-height: none; transform: none; object-fit: contain; }
.world-panel .sector-switcher { padding: 0; gap: 0; border-top: 1px solid #41463a; }
.world-panel .sector-switcher button { flex: 1; border-radius: 0; min-height: 44px; padding: 8px; }
.world-panel .sector-switcher button.active { background: #333a2b; color: #e6d5a6; }
.world-panel .world-viewport.is-zoomed { max-height: min(72dvh, 720px); }
.world-panel .world-viewport.is-zoomed #world { width: max(100%, 960px); min-width: 960px; }
.world-status { padding: 12px 14px; }
.section-heading { margin-top: 26px; }
.toast { left: 50%; }
.skip-link:focus { left: max(16px, calc((100vw - 1360px) / 2 + 16px)); }
html { scroll-padding-top: 80px; }
@media (min-width: 1600px) {
  .app-shell { max-width: 1480px; margin-top: 42px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (max-width: 1400px) {
  .app-shell { margin: 20px; }
  .rail .rail-link { padding-inline: 9px; gap: 6px; }
}
@media (max-width: 1100px) {
  .topbar { padding: 0 22px; height: 240px; gap: 18px; }
  .wordmark strong { font-size: 42px; }
  .resources { left: 22px; }
  .rail .brand-mark { width: 42px; }
  .rail .rail-link { padding-inline: 9px; }
  .rail .rail-link svg { width: 15px; height: 15px; }
  .rail .rail-link small { font-size: 12px; letter-spacing: 0; }
  .rail .commander-avatar { margin-inline: 7px; }
  main { padding: 24px 22px 0; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .right-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 820px) {
  .app-shell { margin: 12px; }
  .rail .rail-link { gap: 5px; padding-inline: 7px; }
  .rail .brand-mark, .rail .commander-avatar { display: none; }
  .rail .rail-link svg { width: 14px; height: 14px; }
  .topbar-end { gap: 8px; padding-left: 12px; }
  .resources { gap: 18px; }
}
@media (max-width: 700px) {
  body { background-size: auto 100dvh; }
  .app-shell { margin: 8px; min-height: calc(100dvh - 16px); }
  .topbar { min-height: 222px; height: 222px; padding: 16px; display: block; }
  .topbar::after { inset: 16px 6px 58px 50%; background-size: auto 75%; background-position: 0 100%, 50% 70%, 100% 100%; opacity: .8; }
  .wordmark { position: relative; margin-top: 20px; max-width: 65%; }
  .wordmark strong { font-size: 29px; line-height: 1.1; letter-spacing: 1px; white-space: normal; }
  .wordmark-sub { font-size: 12px; letter-spacing: 4px; margin-top: 12px; }
  .resources { position: absolute; left: 16px; right: 16px; bottom: 18px; display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0; }
  .resource, .people-resource { display: flex; min-width: 0; gap: 7px; }
  .resource strong { font-size: 16px; }
  .resource small { font-size: 10px; }
  .resource > span svg { width: 20px; height: 20px; }
  .resource-plus { display: inline-flex; min-width: 28px; min-height: 32px; align-items: center; justify-content: center; }
  .topbar .topbar-end { position: absolute; right: 10px; top: 10px; bottom: auto; display: flex; border: 0; padding: 0; gap: 7px; flex-wrap: wrap; max-width: 80px; justify-content: flex-end; }
  .topbar-end .prototype-tag { display: none; }
  .topbar-end .icon-button { min-width: 44px; min-height: 44px; }
  .topbar .topbar-end > #save-button { display: grid; }
  .topbar-end .arena-global-inbox { min-width: 36px; min-height: 36px; }
  .rail { flex-direction: column; position: static; }
  .rail nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .rail .rail-link { min-height: 46px; padding: 8px 5px; gap: 6px; }
  .rail .rail-link small { font-size: 12px; }
  .rail-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #373932; }
  .rail-bottom .rail-link { min-height: 44px; }
  main { padding: 20px 14px 0; }
  .page-heading { margin-bottom: 20px; padding-bottom: 16px; align-items: flex-start; gap: 10px; }
  .page-heading h1 { font-size: 25px; line-height: 1.4; letter-spacing: 1px; }
  .page-heading p { font-size: 11px; }
  .page-heading .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .page-heading-tools { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
  .colony-clock strong { font-size: 9px; }
  .colony-clock small { font-size: 8px; }
  .heading-guide { display: inline-flex; min-height: 36px; padding: 6px; font-size: 10px; }
  .right-column { display: flex; flex-direction: column; }
  .workspace { display: flex; flex-direction: column; }
  .workspace .primary-column { order: 0; }
  .workspace .right-column { order: 1; }
  .world-panel .panel-toolbar { padding: 8px; }
  .world-panel .panel-toolbar h2 { font-size: 11px; }
  .world-panel .sector-switcher button { font-size: 9px; padding: 7px 3px; }
  .world-status { font-size: 8px; gap: 6px; padding: 10px 8px; }
  .toast { bottom: 20px; }
  .footer { padding-bottom: 20px; }
  html { scroll-padding-top: 16px; }
}
