@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap");
:root {
  --ink: #203e3e;
  --muted: #6c7d70;
  --cream: #f8f1d9;
  --line: #d9ddc1;
  --mint: #d8f5b0;
  --orange: #f0b85b;
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  font-size: 14px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #142e35;
}
button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: not-allowed;
  filter: saturate(0.4);
  opacity: 0.48;
}
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ffa75e;
  outline-offset: 3px;
}
button {
  transition:
    transform 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
button:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: none;
}
button[hidden],
[hidden] {
  display: none !important;
}
.game-shell {
  width: 100%;
  height: 100dvh;
  min-height: 580px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 45% 55%,
    #3a6461 0%,
    #234b4f 40%,
    #112b35 100%
  );
  isolation: isolate;
}
.world-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(#a3c9b91a 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(transparent, black);
}
.hud {
  position: absolute;
  top: 22px;
  left: 26px;
  right: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  z-index: 3;
}
.game-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-shadow: 0 3px #0c2528;
  flex-shrink: 0;
}
.game-logo > span {
  font-size: 34px;
  background: #37594f;
  border: 2px solid #91ae82;
  border-radius: 13px;
  padding: 0 8px 4px;
  box-shadow: 0 4px #0b2228;
  color: #d8f7ad;
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 1.1;
}
.game-logo b {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.2;
}
.game-logo small {
  display: block;
  font-size: 22px;
  letter-spacing: 4px;
  color: #d7edb2;
}
.resources {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.resource {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 172px;
  padding: 8px 15px 8px 8px;
  background: linear-gradient(#fff8e5, #ece5c9);
  border: 2px solid #a2b091;
  border-radius: 13px;
  box-shadow:
    0 5px #102b30,
    0 7px 12px #00171b40;
  position: relative;
}
.resource-icon {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  align-self: center;
  border-radius: 50%;
  border: 3px solid #e8e4be;
  box-shadow:
    0 3px #b4b791,
    inset 0 2px #ffffff60;
  font-size: 26px;
  font-weight: 900;
}
.cash {
  background: linear-gradient(#f3d77a, #d3a34d);
  color: #8b6828;
}
.token {
  background: linear-gradient(#a3dace, #64b3a1);
  color: #2a7164;
}
.stars-icon {
  background: linear-gradient(#e2c1ef, #b28acc);
  color: #75518b;
}
.resource small {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.3px;
  color: #87917a;
  display: block;
}
.resource strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.7px;
  font-variant-numeric: tabular-nums;
}
.rate {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #628668;
  margin-top: 1px;
  white-space: nowrap;
}
.utility {
  display: flex;
  gap: 8px;
}
.icon-button {
  display: grid;
  place-items: center;
  background: linear-gradient(#fff8e4, #e6e3cb);
  border: 2px solid #9eaf92;
  border-radius: 12px;
  width: 43px;
  height: 43px;
  box-shadow: 0 4px #0c282b;
  color: #3c6357;
  font-size: 23px;
  font-weight: 900;
}
.icon-button:hover {
  background: #e8f4cd;
}
.world-title {
  position: absolute;
  left: 30px;
  top: 125px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
  color: var(--cream);
  pointer-events: none;
}
.stage-emblem {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  font-size: 28px;
  background: #d5eaaa;
  color: #32594b;
  border: 3px solid #b1c986;
  box-shadow: 0 4px #0d2b2e;
  border-radius: 14px;
  transform: rotate(-5deg);
}
.eyebrow {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #879b79;
  margin: 0 0 6px;
  display: block;
}
.world-title .eyebrow {
  color: #b5cba3;
  font-size: 9px;
  letter-spacing: 2px;
  margin: 0;
}
h1 {
  font-size: 24px;
  margin: 1px 0;
  letter-spacing: -0.5px;
  text-shadow: 0 3px #153b3d;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.6px;
  line-height: 1.2;
  margin: 0 0 5px;
  font-weight: 900;
}
h3 {
  font-size: 19px;
  margin: 0 0 6px;
  font-weight: 900;
}
.world-title p {
  font-size: 11px;
  color: #a7bfb1;
  margin: 3px 0 0;
}
.world-status {
  position: absolute;
  right: 30px;
  top: 133px;
  font-size: 9px;
  color: #c8ddbe;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: right;
  z-index: 2;
}
.world-status i,
.status-light {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b2e58d;
  box-shadow: 0 0 10px #b2e58d70;
  margin-right: 6px;
}
.world-status > span {
  margin-left: 10px;
  color: #8fb2a5;
}
.world-status small {
  display: block;
  font-size: 9px;
  color: #90b1a3;
  margin-top: 7px;
  letter-spacing: 0;
}
.world-status small b {
  color: #bfd7ba;
  font-weight: 700;
}
.world {
  position: absolute;
  inset: 110px 0 105px;
  display: grid;
  place-items: center;
  transition: right 0.25s;
  pointer-events: none;
}
.world > svg {
  height: 100%;
  width: 100%;
  max-width: 1180px;
  overflow: visible;
  pointer-events: auto;
  filter: drop-shadow(0 16px 25px #06262b40);
}
.world-instruction {
  position: absolute;
  bottom: 45px;
  color: #b8d1ba;
  font-weight: 700;
  font-size: 11px;
  padding: 7px 14px;
  background: #12333880;
  border: 1px solid #51736b70;
  border-radius: 20px;
  pointer-events: none;
}
.station {
  cursor: pointer;
  outline: 0;
}
.selection-ring {
  opacity: 0;
  transition: opacity 0.2s;
}
.station:hover .selection-ring,
.station:focus-visible .selection-ring,
.station.selected .selection-ring {
  opacity: 1;
}
.station:focus-visible .selection-ring {
  stroke: #ffcc70;
  stroke-width: 5;
}
.station-label {
  opacity: 0.75;
}
.station:hover .station-label,
.station.selected .station-label {
  opacity: 1;
}
.token-float {
  animation: token-rise 3.5s ease-out infinite;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}
.station:hover > svg {
  filter: brightness(1.08);
}
.quest-tracker {
  position: absolute;
  left: 28px;
  bottom: 200px;
  width: 250px;
  border: 2px solid #b9c99a;
  border-radius: 12px;
  background: linear-gradient(130deg, #fff6d9, #e7e9ca);
  padding: 12px 14px;
  box-shadow:
    0 5px #102f33,
    0 10px 25px #05252830;
  z-index: 2;
}
.quest-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.quest-icon {
  font-size: 28px;
  color: #b18a3c;
}
.quest-top .eyebrow {
  font-size: 8px;
  letter-spacing: 1px;
  margin: 0 0 3px;
  color: #8f9575;
}
.quest-top b {
  font-size: 12px;
  line-height: 1.25;
  display: block;
}
.quest-top > span:last-child {
  margin-left: auto;
  font-size: 10px;
  font-weight: 900;
  color: #83976c;
}
.quest-tracker > p {
  font-size: 10px;
  color: #788469;
  line-height: 1.5;
  margin: 8px 0;
}
.quest-tracker > button {
  border: 0;
  background: transparent;
  padding: 3px 0;
  color: #45715c;
  font-size: 11px;
  font-weight: 900;
}
.expansion {
  position: absolute;
  left: 28px;
  bottom: 123px;
  width: 250px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #dceacb;
  background: #15393de8;
  border: 1px solid #557b6f;
  border-radius: 10px;
  padding: 10px 12px;
  z-index: 2;
  min-height: 61px;
}
.expand-icon {
  font-size: 22px;
  display: none;
}
.expansion b {
  font-size: 11px;
}
.expansion p {
  display: none;
}
.expansion .action {
  width: auto;
  font-size: 10px;
  padding: 8px;
  gap: 7px;
  margin-left: auto;
  border-color: #c1da95;
  white-space: nowrap;
}
.expansion .action span {
  font-size: 10px;
}
.earned {
  font-size: 10px;
  color: #b6d696;
}
.control-panel {
  position: absolute;
  right: 25px;
  top: 118px;
  bottom: 155px;
  width: 330px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(#faf3dc, #eeecd6);
  border: 3px solid #9eaf8c;
  border-radius: 18px;
  box-shadow:
    0 7px #0c282d,
    0 20px 60px #082d3440;
  animation: drawer-in 0.2s ease-out;
}
.drawer-open .world {
  right: 300px;
}
.drawer-open .world-status {
  display: none;
}
.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 5px;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 900;
  color: #829675;
}
.drawer-heading .icon-button {
  box-shadow: none;
  background: transparent;
  border: 0;
  width: 32px;
  height: 30px;
  font-size: 28px;
}
.tabs {
  display: flex;
  padding: 0 12px;
  border-bottom: 2px solid #dce0c5;
  gap: 5px;
}
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 7px;
  flex: 1;
  color: #819078;
  font-weight: 800;
  font-size: 12px;
}
.tabs button.active {
  border-bottom-color: #54735a;
  color: #345944;
}
.panel-content {
  padding: 19px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #b8c59a transparent;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 1px;
}
.count-badge {
  font-size: 11px;
  font-weight: 900;
  background: #e3e9c9;
  border: 1px solid #c2cea5;
  padding: 5px 7px;
  border-radius: 8px;
}
.muted {
  font-size: 12px;
  line-height: 1.5;
  color: #7c8971;
  margin: 4px 0;
}
.intro {
  font-size: 11px;
  margin: 10px 0 19px;
}
.selected-hardware {
  text-align: center;
}
.hardware-art {
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: radial-gradient(ellipse at 50% 70%, #c5d8ad80, transparent 65%);
}
.hardware-art svg {
  width: 165px;
  height: 165px;
  filter: drop-shadow(0 10px 5px #345b3b20);
}
.hardware-art b {
  position: absolute;
  right: 12px;
  bottom: 5px;
  padding: 5px 9px;
  border: 2px solid #a9bf88;
  border-radius: 8px;
  background: #daeaba;
  font-size: 12px;
  box-shadow: 0 3px #a0b67f;
}
.upgrade-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  margin: 16px 0 10px;
  gap: 8px;
}
.upgrade-detail span {
  color: #7f8c71;
}
.upgrade-detail b {
  font-size: 10px;
  font-weight: 900;
}
.tier-next {
  font-size: 10px;
  color: #7a8b68;
  margin: 10px 0;
}
.action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #80985f;
  border-radius: 9px;
  background: linear-gradient(#d9eeac, #b8d67d);
  color: #3c5d34;
  box-shadow: 0 4px #79935a;
  font-size: 12px;
  font-weight: 900;
}
.action span {
  font-size: 11px;
  white-space: nowrap;
}
.action:hover:not(:disabled) {
  background: linear-gradient(#e2f8b3, #c5e38e);
}
.action.secondary {
  background: linear-gradient(#f7f0d3, #e6e8c7);
  border-color: #bdcba2;
  box-shadow: 0 3px #a8b78f;
  color: #54734e;
}
.station-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 20px 0;
}
.station-picker button {
  min-width: 37px;
  min-height: 40px;
  padding: 5px 7px;
  background: #e3e8cb;
  border: 2px solid #c4cfa9;
  border-radius: 8px;
  color: #7b8d6a;
  font-size: 12px;
  font-weight: 900;
}
.station-picker button.active {
  background: #cfe6a2;
  border-color: #79965f;
  color: #3c5f36;
}
.station-picker small {
  display: block;
  font-size: 8px;
}
.add-station {
  border-top: 2px solid #d9dfc1;
  padding-top: 15px;
}
.add-station b {
  font-size: 13px;
}
.add-station .action {
  margin-top: 10px;
}
.tip {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e0e6c9;
  border-top: 2px solid #d0d9b6;
}
.tip > span {
  font-size: 22px;
  color: #8ca578;
}
.tip p {
  font-size: 10px;
  color: #7b8d69;
  margin: 0;
}
.job-card,
.research-card {
  padding: 16px 0;
  border-top: 2px solid #dce0c6;
}
.job-card.chosen {
  padding: 12px;
  border: 2px solid #b6cd94;
  border-radius: 11px;
  background: #e7efcf;
  margin-bottom: 12px;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.tiny-tag {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #849472;
}
.job-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 13px 0;
  gap: 5px;
}
.job-meta b {
  font-size: 18px;
}
.job-meta small {
  font-size: 9px;
  color: #89977b;
}
.job-meta > span {
  font-size: 9px;
  color: #879577;
}
.progress {
  height: 9px;
  background: #d1ddba;
  border: 1px solid #c2d0a9;
  border-radius: 6px;
  overflow: hidden;
  margin: 12px 0 7px;
}
.progress span {
  height: 100%;
  background: linear-gradient(#b6d977, #81af51);
  display: block;
  border-radius: 5px;
  transition: width 0.25s;
}
.progress-label {
  font-size: 10px;
  color: #78925e;
}
.research-card.done h3 {
  color: #8a9d72;
}
.research-card .action {
  margin-top: 12px;
}
.build-status {
  position: absolute;
  left: 50%;
  bottom: 128px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 360px;
  padding: 10px 13px;
  background: #12353bd9;
  border: 1px solid #608678;
  border-radius: 13px;
  box-shadow: 0 4px #0e2b30;
  color: #e0ebd1;
  z-index: 3;
}
.build-status b {
  display: block;
  font-size: 12px;
}
.build-status span:not(.status-light) {
  display: block;
  font-size: 9px;
  color: #9fbd9e;
}
.build-status .status-light {
  width: 6px;
  height: 6px;
  margin: 0;
}
.mini-progress {
  height: 6px;
  width: 65px;
  background: #476a5e;
  border-radius: 5px;
  overflow: hidden;
  margin-left: auto;
}
.mini-progress i {
  display: block;
  background: #bbdf87;
  height: 100%;
  border-radius: 5px;
  transition: width 0.25s;
}
.build-status button {
  border: 1px solid #aa944c;
  background: linear-gradient(#f3d67b, #dbb657);
  color: #64552b;
  border-radius: 7px;
  padding: 8px;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 3px #846f3e;
  margin-left: 3px;
}
.action-dock {
  position: absolute;
  bottom: 31px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: linear-gradient(#e5e3c9, #bfcbb0);
  border: 3px solid #8aa583;
  border-radius: 20px;
  box-shadow:
    0 7px #0b282d,
    0 15px 30px #0a242b50;
  z-index: 4;
}
.action-dock .dock-actions > button {
  width: 85px;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: linear-gradient(#f9f2d9, #e6e7ca);
  border: 2px solid #bdc6a2;
  box-shadow: 0 4px #9cae86;
  border-radius: 12px;
  color: #57734f;
  position: relative;
}
.action-dock .dock-actions > button.active {
  background: linear-gradient(#d9f3ae, #b9d784);
  border-color: #8ba966;
  box-shadow: 0 4px #749351;
}
.action-dock .dock-actions > button > span {
  font-size: 25px;
  line-height: 1.05;
}
.action-dock .dock-actions > button > b {
  font-size: 11px;
  font-weight: 900;
}
.action-dock .dock-actions > button > small {
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #879974;
  margin-top: 3px;
}
.action-dock #launch {
  background: linear-gradient(#efd997, #d6b363);
  color: #7e6533;
  border-color: #c5a45c;
  box-shadow: 0 4px #8b7544;
}
.action-dock #launch.ready {
  animation: glow 2s infinite;
}
.journey {
  position: absolute;
  right: 28px;
  bottom: 46px;
  display: flex;
  gap: 5px;
  z-index: 2;
  flex-direction: column;
}
.journey > span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: #719d8d;
  font-weight: 800;
}
.journey i {
  font-style: normal;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #58796b;
  border-radius: 6px;
  font-size: 9px;
}
.journey .reached {
  color: #d0e1bb;
}
.journey .reached i {
  background: #6d976b;
  color: #dcf5b9;
  border-color: #a8c28c;
}
.build-log {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  color: #729889;
  gap: 12px;
  pointer-events: none;
}
.build-log p {
  margin: 0;
}
.build-log span {
  font-size: 8px;
}
.toast {
  position: fixed;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 21px;
  background: linear-gradient(#fcf1ce, #e8e7bd);
  color: #587045;
  border: 2px solid #a7bd80;
  box-shadow:
    0 5px #103136,
    0 12px 30px #0b2a3750;
  border-radius: 12px;
  z-index: 20;
  font-size: 13px;
  font-weight: 800;
  max-width: min(500px, 90vw);
  text-align: center;
  animation: toast-in 0.25s ease-out;
}
dialog {
  border: 3px solid #9bb084;
  border-radius: 20px;
  background: linear-gradient(#fbf2d8, #ecebd0);
  color: var(--ink);
  padding: 34px;
  width: min(490px, 94vw);
  max-height: 90dvh;
  box-shadow:
    0 8px #102e33,
    0 40px 100px #051b28a0;
}
dialog::backdrop {
  background: #0b222ad9;
  backdrop-filter: blur(7px);
}
.close-dialog {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-width: 1px;
  box-shadow: 0 2px #a1b58b;
  font-size: 23px;
}
dialog h2 {
  font-size: 28px;
  margin: 10px 0 18px;
}
dialog p,
dialog li {
  font-size: 13px;
  line-height: 1.7;
  color: #74836b;
}
dialog li {
  padding: 5px 0;
}
dialog .action {
  margin-top: 14px;
}
dialog ol,
dialog ul {
  padding-left: 20px;
}
.offline-number {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -2px;
  margin: 12px 0;
  color: #517a45;
}
.medals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 20px 0;
}
.medal {
  background: #e2e5cb;
  border: 2px solid #d1d9ba;
  border-radius: 12px;
  padding: 10px 7px;
  text-align: center;
  filter: grayscale(1);
  opacity: 0.5;
}
.medal.earned {
  filter: none;
  opacity: 1;
  background: #ebefca;
  border-color: #b7ce87;
}
.medal > span:first-child {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  background: #bac3a5;
  border: 3px solid #d2d8b5;
  border-radius: 50%;
  font-size: 25px;
  color: #77916a;
  box-shadow: 0 3px #a6b18e;
}
.medal.earned > span:first-child {
  background: linear-gradient(#f6df83, #d4ad4e);
  border-color: #e9d48d;
  color: #8f7235;
  box-shadow: 0 3px #b49851;
}
.medal b {
  display: block;
  font-size: 10px;
}
.medal small {
  font-size: 9px;
  display: block;
  line-height: 1.4;
  margin-top: 4px;
  color: #879570;
}
.share-preview {
  padding: 22px;
  background: #234c4b;
  border: 2px solid #71956f;
  border-radius: 15px;
  color: #e4efc8;
  margin: 17px 0;
}
.share-preview strong {
  display: block;
  font-size: 27px;
  font-weight: 900;
}
.share-preview p {
  color: #b5d1a4;
  font-size: 12px;
}
.share-row {
  display: flex;
  gap: 10px;
}
.share-row .action {
  justify-content: center;
}
.share-text {
  width: 100%;
  min-height: 100px;
  border: 1px solid #bdcba5;
  border-radius: 8px;
  background: #f8f4e0;
  color: #526f51;
  padding: 10px;
  font: inherit;
  font-size: 12px;
}
.purchase-particle {
  position: absolute;
  top: 35%;
  left: 50%;
  font-size: 24px;
  color: #e3ffb2;
  text-shadow: 0 3px #23593b;
  font-weight: 900;
  animation: reward-rise 1.4s ease-out forwards;
  pointer-events: none;
  z-index: 7;
}
@keyframes token-rise {
  0%,
  20% {
    opacity: 0;
    transform: translateY(15px) scale(0.8);
  }
  40% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1);
  }
}
@keyframes reward-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -5px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -90px) scale(1);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes glow {
  50% {
    box-shadow:
      0 4px #8b7544,
      0 0 18px #f6d98980;
  }
}
@media (min-width: 1650px) {
  .world {
    inset: 90px 0 105px;
  }
  .world > svg {
    max-width: 1400px;
  }
  .quest-tracker,
  .expansion {
    left: 40px;
  }
  .hud {
    left: 40px;
    right: 40px;
  }
}
@media (max-width: 1100px) {
  .game-logo b {
    display: none;
  }
  .resource {
    min-width: 145px;
    padding: 7px 10px 7px 7px;
  }
  .resources {
    gap: 8px;
  }
  .resource strong {
    font-size: 21px;
  }
  .resource-icon {
    min-width: 34px;
    height: 34px;
    font-size: 22px;
  }
  .quest-tracker {
    width: 210px;
    left: 18px;
  }
  .expansion {
    width: 210px;
    left: 18px;
    padding: 8px;
  }
  .expansion b {
    font-size: 10px;
  }
  .expansion .action {
    font-size: 9px;
    padding: 7px;
  }
  .journey {
    right: 18px;
  }
  .control-panel {
    right: 18px;
    width: 310px;
  }
  .world-title {
    left: 20px;
    top: 115px;
  }
  .world-status {
    right: 20px;
  }
  .action-dock {
    gap: 5px;
    padding: 8px;
  }
  .action-dock .dock-actions > button {
    width: 73px;
  }
  .drawer-open .world {
    right: 270px;
  }
  .quest-tracker {
    bottom: 205px;
  }
  .build-status {
    bottom: 124px;
    min-width: 330px;
  }
}
@media (max-width: 800px) {
  .hud {
    left: 15px;
    right: 15px;
    top: 15px;
    gap: 8px;
  }
  .game-logo {
    display: none;
  }
  .resources {
    flex: 1;
    justify-content: flex-start;
    gap: 8px;
  }
  .resource {
    min-width: 125px;
  }
  .stars-resource {
    display: none;
  }
  .utility {
    gap: 6px;
  }
  .utility .icon-button {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .utility #help {
    display: none;
  }
  .world-title {
    top: 101px;
  }
  .world-status {
    top: 110px;
  }
  .world-title p {
    display: none;
  }
  h1 {
    font-size: 21px;
  }
  .stage-emblem {
    width: 39px;
    height: 39px;
    font-size: 24px;
  }
  .world-title .eyebrow {
    font-size: 8px;
  }
  .world {
    inset: 110px -60px 140px;
  }
  .world > svg {
    max-height: 650px;
  }
  .quest-tracker {
    bottom: auto;
    top: 166px;
    width: 225px;
    left: 19px;
    padding: 9px 12px;
  }
  .quest-tracker > p {
    display: none;
  }
  .quest-top b {
    font-size: 11px;
  }
  .quest-top .eyebrow {
    font-size: 7px;
  }
  .quest-tracker > button {
    font-size: 10px;
    padding: 2px 0;
    margin: 3px 0 0 32px;
  }
  .quest-icon {
    font-size: 23px;
  }
  .expansion {
    left: 18px;
    bottom: 135px;
    width: 205px;
    min-height: 55px;
  }
  .build-status {
    left: auto;
    right: 18px;
    bottom: 135px;
    transform: none;
    min-width: 0;
    gap: 7px;
  }
  .mini-progress {
    display: none;
  }
  .build-status .status-light {
    display: none;
  }
  .build-status button {
    font-size: 10px;
  }
  .journey {
    display: none;
  }
  .world-instruction {
    bottom: 33px;
  }
  .drawer-open .world {
    right: -60px;
  }
  .control-panel {
    top: 100px;
    bottom: 130px;
    right: 15px;
    width: 310px;
  }
  .build-log {
    font-size: 7px;
    left: 18px;
    right: 18px;
  }
  .build-log p {
    max-width: 55%;
  }
  .action-dock {
    bottom: 29px;
  }
}
@media (max-width: 520px) {
  .game-shell {
    min-height: 550px;
  }
  .hud {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .resource {
    min-width: 0;
    flex: 1;
    gap: 6px;
    border-radius: 11px;
    padding: 5px 8px 6px 5px;
  }
  .resource-icon {
    min-width: 29px;
    height: 29px;
    border-width: 2px;
    font-size: 20px;
  }
  .resource strong {
    font-size: 21px;
  }
  .resource small {
    font-size: 7px;
    letter-spacing: 0.7px;
  }
  .rate {
    font-size: 8px;
  }
  .utility {
    flex-direction: column;
    gap: 7px;
    align-self: flex-start;
  }
  .utility .icon-button {
    width: 31px;
    height: 31px;
    font-size: 20px;
    border-radius: 9px;
    box-shadow: 0 3px #0c282b;
  }
  .resources {
    gap: 8px;
    align-self: flex-start;
  }
  .world-title {
    left: 15px;
    top: 101px;
    gap: 9px;
  }
  .stage-emblem {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    font-size: 20px;
  }
  h1 {
    font-size: 19px;
  }
  .world-title .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .world-status {
    top: 153px;
    left: 15px;
    right: auto;
    text-align: left;
    font-size: 7px;
  }
  .world-status small {
    font-size: 8px;
    margin-top: 4px;
  }
  .world-status > span {
    margin-left: 6px;
  }
  .world {
    inset: 150px -120px 143px;
  }
  .world > svg {
    max-height: 560px;
    min-height: 370px;
  }
  .world-instruction {
    font-size: 9px;
    bottom: 11px;
  }
  .quest-tracker {
    left: 15px;
    top: auto;
    bottom: 177px;
    width: 190px;
    z-index: 2;
    opacity: 0.96;
    padding: 8px 10px;
  }
  .quest-icon {
    font-size: 20px;
  }
  .quest-top {
    gap: 7px;
  }
  .quest-top b {
    font-size: 10px;
  }
  .quest-top > span:last-child {
    font-size: 9px;
  }
  .quest-tracker > button {
    font-size: 10px;
    margin: 2px 0 0 27px;
  }
  .quest-tracker .eyebrow {
    font-size: 6px;
  }
  .expansion {
    left: 15px;
    right: 15px;
    width: auto;
    bottom: 116px;
    padding: 7px 10px;
    min-height: 48px;
    gap: 5px;
  }
  .expansion b {
    font-size: 11px;
  }
  .expansion .action {
    padding: 7px 9px;
    font-size: 10px;
    gap: 10px;
  }
  .expansion .action span {
    font-size: 11px;
  }
  .build-status {
    right: 15px;
    bottom: 177px;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }
  .build-status b {
    font-size: 9px;
  }
  .build-status span:not(.status-light) {
    font-size: 8px;
    text-align: right;
  }
  .build-status button {
    font-size: 9px;
    padding: 7px 8px;
  }
  .action-dock {
    width: calc(100% - 24px);
    max-width: 420px;
    gap: 4px;
    padding: 7px;
    border-width: 2px;
    bottom: 28px;
    border-radius: 15px;
  }
  .action-dock .dock-actions > button {
    flex: 1;
    width: 0;
    min-height: 62px;
    border-radius: 10px;
  }
  .action-dock .dock-actions > button > span {
    font-size: 25px;
  }
  .action-dock .dock-actions > button > b {
    font-size: 9px;
  }
  .action-dock .dock-actions > button > small {
    font-size: 5px;
    letter-spacing: 0.5px;
  }
  .build-log {
    bottom: 7px;
    font-size: 7px;
    left: 15px;
    right: 15px;
  }
  .build-log p {
    max-width: 62%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .build-log span {
    font-size: 7px;
    max-width: 35%;
    text-align: right;
  }
  .control-panel {
    top: 90px;
    bottom: 113px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    border-width: 2px;
    border-radius: 16px;
    box-shadow:
      0 6px #0e2e33,
      0 0 0 100vmax #0a252b70;
  }
  .drawer-heading {
    padding: 8px 15px 0;
  }
  .drawer-heading .icon-button {
    height: 28px;
  }
  .panel-content {
    padding: 16px 20px;
  }
  .tabs button {
    padding: 10px;
    font-size: 12px;
  }
  .intro {
    margin: 8px 0 15px;
  }
  .hardware-art {
    height: 120px;
  }
  .hardware-art svg {
    width: 145px;
    height: 145px;
  }
  .selected-hardware h3 {
    font-size: 20px;
  }
  .tip {
    display: none;
  }
  .toast {
    top: 90px;
    font-size: 12px;
    padding: 10px 14px;
  }
  dialog {
    padding: 30px 22px;
  }
  dialog h2 {
    font-size: 25px;
  }
  .medals {
    gap: 6px;
  }
  .medal {
    padding: 10px 5px;
  }
  .medal b {
    font-size: 9px;
  }
  .medal small {
    font-size: 8px;
  }
}
@media (max-height: 720px) and (min-width: 801px) {
  .hud {
    top: 12px;
  }
  .resource {
    padding: 5px 12px 5px 7px;
  }
  .resource strong {
    font-size: 21px;
  }
  .world-title {
    top: 96px;
  }
  .world-title p {
    display: none;
  }
  .world-status {
    top: 105px;
  }
  .world {
    inset: 55px 0 75px;
  }
  .quest-tracker {
    bottom: 188px;
  }
  .expansion {
    bottom: 111px;
  }
  .action-dock {
    bottom: 24px;
  }
  .build-status {
    bottom: 116px;
  }
  .control-panel {
    top: 93px;
    bottom: 135px;
  }
  .hardware-art {
    height: 100px;
  }
  .hardware-art svg {
    width: 125px;
    height: 125px;
  }
  .intro {
    font-size: 10px;
    margin: 6px 0 12px;
  }
  .drawer-open .world {
    right: 270px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .token-float {
    opacity: 0.5;
  }
}
.capacity-controls {
  margin: 8px 14px 0;
  padding: 11px 13px;
  background: #e0e8c6;
  border: 2px solid #bccd9a;
  border-radius: 11px;
  flex-shrink: 0;
}
.capacity-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.capacity-title > span {
  font-size: 19px;
  color: #86a267;
}
.capacity-controls p {
  font-size: 10px;
  line-height: 1.4;
  margin: 3px 0 8px;
  color: #73876a;
}
.capacity-controls .action {
  font-size: 12px;
  padding: 9px 11px;
}
.capacity-controls > small {
  display: block;
  font-size: 10px;
  margin-top: 9px;
  font-weight: 800;
  color: #7c8e65;
}
.lab-buddy {
  position: absolute;
  left: 80px;
  bottom: 350px;
  width: 112px;
  pointer-events: none;
  z-index: 2;
  text-align: center;
  filter: drop-shadow(0 8px 6px #06252960);
}
.buddy-sprite {
  width: 110px;
  height: 110px;
  background-image: url("assets/assistant-atlas.png");
  background-size: 200% 200%;
  background-position: 0 0;
  animation: buddy-idle 3s ease-in-out infinite;
}
.lab-buddy[data-pose="1"] .buddy-sprite {
  background-position: 100% 0;
  animation: buddy-work 0.55s ease-in-out infinite alternate;
}
.lab-buddy[data-pose="2"] .buddy-sprite {
  background-position: 0 100%;
  animation: buddy-think 2s ease-in-out infinite;
}
.lab-buddy[data-pose="3"] .buddy-sprite {
  background-position: 100% 100%;
  animation: buddy-celebrate 0.5s ease-out 3;
}
.buddy-caption {
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  color: #acd1af;
  background: #173c3bcc;
  padding: 4px 8px;
  border: 1px solid #648e7260;
  border-radius: 10px;
  display: inline-block;
}
.event-burst {
  position: absolute;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 9;
  color: var(--event-color);
}
.event-burst > i {
  position: absolute;
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 2px #285a4480;
  animation: event-particle 1.2s ease-out forwards;
}
.event-burst > b {
  position: absolute;
  left: 0;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 3px #1c5140;
  animation: event-label 1.4s ease-out forwards;
}
.lab-celebration .world > svg {
  animation: lab-light 1s ease-out;
}
.action-dock [data-tab="jobs"].new-contract::after {
  content: "!";
  position: absolute;
  top: -6px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #edb84f;
  color: #6c502a;
  border: 2px solid #ffe4a3;
  font-size: 11px;
  display: grid;
  place-items: center;
}
@keyframes buddy-idle {
  50% {
    transform: translateY(-4px) rotate(2deg);
  }
}
@keyframes buddy-work {
  to {
    transform: translateY(-3px) rotate(-3deg);
  }
}
@keyframes buddy-think {
  50% {
    transform: translateY(-5px);
    filter: drop-shadow(0 0 6px #acfac560);
  }
}
@keyframes buddy-celebrate {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-14px) scale(1.05);
  }
}
@keyframes event-particle {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4);
  }
  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--spin)) scale(1.15);
  }
}
@keyframes event-label {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70px);
  }
}
@keyframes lab-light {
  40% {
    filter: brightness(1.14) drop-shadow(0 0 30px #d4ed9f40);
  }
}
@media (max-width: 1100px) {
  .lab-buddy {
    left: 55px;
    bottom: 350px;
  }
}
@media (max-width: 800px) {
  .lab-buddy {
    left: auto;
    right: 24px;
    bottom: auto;
    top: 215px;
    width: 90px;
  }
  .buddy-sprite {
    width: 90px;
    height: 90px;
  }
  .buddy-caption {
    font-size: 8px;
  }
  .drawer-open .lab-buddy {
    visibility: hidden;
  }
}
@media (max-width: 520px) {
  .lab-buddy {
    right: 15px;
    top: 195px;
    width: 65px;
  }
  .buddy-sprite {
    width: 65px;
    height: 65px;
  }
  .buddy-caption {
    display: none;
  }
  .capacity-controls {
    padding: 9px 12px;
    margin: 6px 14px 0;
  }
  .capacity-controls .action {
    min-height: 40px;
  }
  .capacity-controls > small {
    font-size: 9px;
  }
  .control-panel .section-heading h2 {
    font-size: 20px;
  }
  .control-panel .intro {
    font-size: 10px;
  }
  .hardware-art {
    height: 95px;
  }
  .hardware-art svg {
    width: 115px;
    height: 115px;
  }
  .station-picker {
    margin: 13px 0;
  }
  .event-burst > b {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .buddy-sprite,
  .event-burst > i,
  .event-burst > b,
  .lab-celebration .world > svg {
    animation: none !important;
  }
  .event-burst {
    display: none;
  }
}
/* The world has its own bounded viewport; HUD controls never cover station targets. */
.game-shell > .world {
  inset: 155px 140px 225px 285px;
  display: block;
  overflow: hidden;
  min-height: 0;
}
.game-shell > .world > #lab {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  max-width: none;
  overflow: hidden;
}
.game-shell.drawer-open > .world {
  right: 375px;
}
.game-shell .world-instruction {
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}
.game-shell > .build-status {
  bottom: 128px;
}
.game-shell > .action-dock {
  bottom: 31px;
}
.game-shell > .lab-buddy {
  pointer-events: none;
}
.audio-controls {
  margin: 18px 0;
  padding: 14px;
  background: #e2e9ca;
  border: 1px solid #becda2;
  border-radius: 10px;
}
.audio-controls label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  font-size: 13px;
  font-weight: 800;
  color: #5e7953;
}
.audio-controls input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #608249;
}
.audio-controls input[type="range"] {
  width: 150px;
  accent-color: #608249;
}
#sound[aria-pressed="true"] {
  background: linear-gradient(#d9efac, #b5d580);
  color: #4d713a;
}
@media (max-width: 1100px) {
  .game-shell > .world {
    inset: 150px 25px 220px 240px;
  }
  .game-shell.drawer-open > .world {
    right: 345px;
  }
}
@media (max-width: 800px) {
  .game-shell > .world,
  .game-shell.drawer-open > .world {
    inset: 205px 15px 230px;
  }
  .game-shell > .quest-tracker {
    top: 155px;
    bottom: auto;
    left: 18px;
  }
  .game-shell > .lab-buddy {
    top: 145px;
    right: 45px;
    width: 70px;
  }
  .game-shell .buddy-sprite {
    width: 70px;
    height: 70px;
  }
  .game-shell .buddy-caption {
    display: none;
  }
  .game-shell > .expansion {
    bottom: 135px;
  }
  .game-shell > .build-status {
    bottom: 135px;
  }
}
@media (max-width: 520px) {
  .game-shell > .world,
  .game-shell.drawer-open > .world {
    inset: 185px 4px 280px;
  }
  .game-shell > .quest-tracker {
    top: auto;
    bottom: 177px;
    left: 15px;
  }
  .game-shell > .lab-buddy {
    top: 132px;
    right: 35px;
    width: 48px;
  }
  .game-shell .buddy-sprite {
    width: 48px;
    height: 48px;
  }
  .game-shell > .build-status {
    bottom: 177px;
  }
  .game-shell > .expansion {
    bottom: 116px;
  }
  .game-shell > .action-dock {
    bottom: 28px;
  }
  .game-shell .world-instruction {
    font-size: 8px;
    padding: 4px 8px;
  }
  .game-shell .utility {
    gap: 5px;
  }
  .game-shell .utility .icon-button {
    width: 32px;
    height: 32px;
  }
}
@media (max-height: 680px) and (min-width: 801px) {
  .game-shell > .world {
    top: 132px;
    bottom: 208px;
  }
  .game-shell > .build-status {
    bottom: 119px;
  }
  .game-shell > .action-dock {
    bottom: 24px;
  }
}
#burst kbd {
  font:
    800 8px Nunito,
    system-ui,
    sans-serif;
  padding: 2px 4px;
  margin-left: 5px;
  border: 1px solid #9e843f;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #ffeb9d80;
  color: #76602f;
}
@media (pointer: coarse) {
  #burst kbd {
    display: none;
  }
}
/* One compact control dock leaves the camera most of the screen. */
.game-shell > .world,
.game-shell.drawer-open > .world {
  inset: 145px 16px 170px;
}
.game-shell > .action-dock {
  bottom: 26px;
  flex-direction: column;
  gap: 5px;
  padding: 6px 10px 10px;
}
.dock-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}
.action-dock .build-status {
  position: static;
  transform: none;
  left: auto;
  right: auto;
  bottom: auto;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #abbc92;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 3px 3px 9px;
  color: #4d6c46;
}
.action-dock .build-status span:not(.status-light) {
  color: #819674;
  font-size: 8px;
  text-align: left;
}
.action-dock .build-status b {
  font-size: 11px;
}
.action-dock .build-status .status-light {
  display: inline-block;
  background: #729955;
  box-shadow: none;
}
.action-dock .build-status button {
  margin-left: auto;
  font-size: 10px;
  padding: 7px 9px;
}
.action-dock .mini-progress {
  width: 70px;
  margin-left: auto;
}
.game-shell > .quest-tracker {
  left: 24px;
  bottom: 210px;
}
.game-shell > .expansion {
  bottom: 132px;
  left: 24px;
}
.game-shell > .lab-buddy {
  left: 65px;
  bottom: 365px;
}
.game-shell .world-instruction {
  bottom: 0;
  font-size: 10px;
}
#lab {
  touch-action: none;
  user-select: none;
  cursor: grab;
}
#lab:active {
  cursor: grabbing;
}
.camera-tools {
  position: absolute;
  top: 0;
  right: 12px;
  display: flex;
  gap: 5px;
  pointer-events: auto;
  z-index: 2;
}
.camera-tools button {
  min-width: 38px;
  min-height: 36px;
  border: 1px solid #789b80;
  background: #224e4ce8;
  color: #d9eabe;
  border-radius: 8px;
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 3px #0c2b30;
}
.camera-tools #fit-camera {
  font-size: 10px;
  padding: 0 10px;
}
.drawer-open .camera-tools {
  right: 350px;
}
.quest-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  filter: drop-shadow(0 2px 1px #88703a25);
}
.quest-icon svg {
  display: block;
}
@media (max-width: 1100px) {
  .game-shell > .world,
  .game-shell.drawer-open > .world {
    inset: 140px 12px 170px;
  }
  .dock-actions {
    gap: 5px;
  }
  .drawer-open .camera-tools {
    right: 330px;
  }
  .game-shell > .quest-tracker,
  .game-shell > .expansion {
    left: 16px;
  }
}
@media (max-width: 800px) {
  .game-shell > .world,
  .game-shell.drawer-open > .world {
    inset: 177px 8px 190px;
  }
  .game-shell > .quest-tracker {
    top: 154px;
    bottom: auto;
    left: 18px;
    width: 225px;
  }
  .game-shell > .expansion {
    bottom: 162px;
    width: 205px;
  }
  .game-shell > .lab-buddy {
    left: auto;
    right: 155px;
    top: 142px;
    bottom: auto;
    width: 48px;
  }
  .game-shell .buddy-sprite {
    width: 48px;
    height: 48px;
  }
  .drawer-open .camera-tools {
    right: 12px;
  }
  .camera-tools {
    top: 12px;
  }
  .game-shell > .action-dock {
    bottom: 25px;
  }
  .quest-icon {
    width: 28px;
    height: 30px;
  }
  .quest-icon svg {
    width: 28px;
    height: 28px;
  }
}
@media (max-width: 520px) {
  .game-shell > .world,
  .game-shell.drawer-open > .world {
    inset: 183px 4px 205px;
  }
  .game-shell > .action-dock {
    bottom: 25px;
    gap: 5px;
    padding: 6px;
  }
  .dock-actions {
    gap: 4px;
  }
  .action-dock .build-status {
    padding: 1px 3px 8px;
    gap: 6px;
  }
  .action-dock .build-status b {
    font-size: 10px;
  }
  .action-dock .build-status button {
    font-size: 9px;
    padding: 7px;
  }
  .action-dock .build-status .mini-progress {
    display: block;
    width: 35px;
  }
  .action-dock .build-status .status-light {
    display: none;
  }
  .game-shell > .quest-tracker {
    top: auto;
    bottom: 197px;
    width: 190px;
    opacity: 0.93;
  }
  .game-shell > .expansion {
    bottom: 153px;
    left: 15px;
    right: 15px;
    width: auto;
    min-height: 36px;
  }
  .game-shell > .lab-buddy {
    top: 136px;
    right: 90px;
    width: 43px;
  }
  .game-shell .buddy-sprite {
    width: 43px;
    height: 43px;
  }
  .camera-tools {
    top: 0;
    right: 8px;
    gap: 4px;
  }
  .camera-tools button {
    min-width: 36px;
    min-height: 36px;
  }
  .game-shell .world-instruction {
    font-size: 8px;
    bottom: 5px;
  }
  .quest-icon {
    width: 25px;
    height: 28px;
  }
  .quest-icon svg {
    width: 26px;
    height: 26px;
  }
  .quest-top {
    gap: 6px;
  }
}
.share-card-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1200/630;
  overflow: hidden;
  border-radius: 13px;
  border: 2px solid #8cab80;
  margin: 17px 0 5px;
  background: #163c3e;
  box-shadow: 0 4px #a6b48c;
}
.share-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.share-card-status {
  color: #d5e7b5;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  margin: 0;
}
.share-card-image[hidden],
.share-card-status[hidden] {
  display: none;
}
.share-link {
  margin: 17px 0 8px;
  padding: 10px 12px;
  border: 1px dashed #bacba4;
  border-radius: 8px;
  background: #e3e9ca;
  color: #55754e;
}
.share-link span {
  display: block;
  font-size: 8px;
  letter-spacing: 1px;
  font-weight: 900;
  color: #8ba274;
  margin-bottom: 3px;
}
.share-link strong {
  font-size: 15px;
}
.share-preview-note {
  font-size: 10px !important;
  line-height: 1.5 !important;
  color: #8a906e !important;
}
.share-row .action {
  white-space: nowrap;
  font-size: 11px;
  padding: 11px 9px;
}
.share-text {
  min-height: 90px;
  font-size: 11px;
}
.share-row {
  gap: 8px;
}
@media (min-width: 801px) {
  .camera-tools {
    top: 42px;
  }
}
/* Share panel geometry so the adjacent camera toolbar follows every breakpoint. */
.game-shell {
  --panel-top: 118px;
  --panel-right: 25px;
  --panel-width: 330px;
  --camera-top: 187px;
  --camera-right: 28px;
}
.game-shell > .control-panel {
  top: var(--panel-top);
  right: var(--panel-right);
  width: var(--panel-width);
}
.game-shell > .camera-tools {
  top: var(--camera-top);
  right: var(--camera-right);
}
.game-shell.drawer-open > .camera-tools {
  top: var(--panel-top);
  right: calc(var(--panel-right) + var(--panel-width) + 12px);
}
@media (max-width: 1100px) {
  .game-shell {
    --panel-right: 18px;
    --panel-width: 310px;
    --camera-top: 182px;
    --camera-right: 24px;
  }
}
@media (max-height: 720px) and (min-width: 801px) {
  .game-shell {
    --panel-top: 93px;
  }
}
@media (max-width: 800px) {
  .game-shell {
    --panel-top: 100px;
    --panel-right: 15px;
    --camera-top: 189px;
    --camera-right: 20px;
  }
  .game-shell.drawer-open > .camera-tools {
    display: none;
  }
}
@media (max-width: 520px) {
  .game-shell {
    --panel-top: 90px;
    --panel-right: 12px;
    --camera-top: 183px;
    --camera-right: 12px;
  }
  .game-shell > .control-panel {
    width: auto;
  }
}

/* Model families and the permanent ten-founder reward. */
button.stars-resource {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
button.stars-resource:hover {
  border-color: #dfc478;
}
.capability-icon {
  flex: 0 0 42px;
  border: 1px solid #355d4820;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #244b48;
  background: var(--card-accent, #cce5b3);
  box-shadow: 0 3px #8d9f77;
}
.hardware-requirement {
  display: inline-block;
  color: #5b7562;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  background: #e1e8cd;
  border-radius: 6px;
}
.research-lock {
  font-size: 11px;
  font-weight: 800;
  color: #8c713c;
  margin: 9px 0 0;
}
.founder-track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  margin: 0 0 18px;
  text-align: left;
  font: inherit;
  color: #3f6552;
  background: #f0e7be;
  border: 2px solid #bea96b;
  border-radius: 13px;
  cursor: pointer;
}
.founder-track > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.founder-track b {
  display: block;
  font-size: 12px;
}
.founder-track small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
}
.founder-track .progress {
  display: block;
  height: 5px;
  margin: 9px 0 0;
}
.founder-track .progress > span {
  background: #c39a43;
}
.founder-seal {
  font-size: 29px;
  color: #aa8032;
}
.founder-reward {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 22px 0;
}
.reward-byte {
  flex: 0 0 145px;
  height: 145px;
  background: url(assets/frontier-assistant-atlas.png) 100% 100% / 200% 200%
    no-repeat;
}
.founder-badge {
  display: inline-block;
  padding: 7px 11px;
  border: 1px solid #b69a56;
  border-radius: 20px;
  background: #f1dda0;
  color: #71602f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
}
.frontier-lab {
  background-color: #183f40;
}
.frontier-lab .buddy-sprite {
  background-image: url(assets/frontier-assistant-atlas.png);
}
.frontier-lab .stars-icon {
  background: linear-gradient(#ffe6a1, #d8ad53);
  color: #896629;
}
.frontier-lab .control-panel,
.frontier-lab .action-dock {
  border-color: #c4b177;
}
.frontier-lab .stage-emblem {
  background: #efda94;
  color: #85692d;
  border-color: #c6ac63;
}
.frontier-lab .world-status::after {
  content: "FRONTIER FOUNDER";
  display: block;
  color: #ebd38e;
  font-size: 9px;
  margin-top: 8px;
}
.frontier-lab .station.selected .station-label rect {
  stroke: #f0d380;
}
.event-burst {
  color: var(--active-model-color, #dbefb1);
}
@media (max-width: 520px) {
  .founder-reward {
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }
  .reward-byte {
    flex-basis: auto;
    width: 110px;
    height: 110px;
    align-self: center;
  }
}

.game-icon {
  display: inline-block;
  width: var(--icon-size, 1em);
  height: var(--icon-size, 1em);
  flex-shrink: 0;
  vertical-align: -0.15em;
}
.capability-icon > .game-icon {
  width: 26px;
  height: 26px;
}
.resource-icon > .game-icon,
.stage-emblem > .game-icon,
.icon-button .game-icon,
.dock-actions > button > span > .game-icon {
  display: block;
}
#burst [data-ui-icon] {
  color: inherit;
  font-size: 1em;
  display: inline-flex;
  vertical-align: middle;
}

.lab-name {
  display: block;
  color: #c6dcb6;
  font-weight: 800;
  font-size: 12px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.lab-name-form {
  margin: 20px 0;
}
.lab-name-form label {
  display: block;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
}
.lab-name-form label small {
  font-size: 10px;
  font-weight: 600;
  color: #7b8c6e;
  margin-left: 8px;
}
.lab-name-form input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #b9c99b;
  border-radius: 10px;
  color: #24484a;
  background: #fffbea;
  font:
    700 16px Nunito,
    system-ui;
  margin-bottom: 12px;
}
.quick-tour {
  padding-left: 22px;
  margin: 20px 0;
}
.quick-tour li {
  padding-left: 5px;
  margin: 10px 0;
  line-height: 1.5;
}
.quiet-start {
  margin-top: 10px;
}
@media (max-width: 800px) {
  .lab-name {
    font-size: 10px;
    margin-top: 3px;
  }
}

.card-top {
  gap: 12px;
  min-height: 45px;
}
.tiny-tag {
  font-size: 9px;
  color: #657d57;
  text-align: right;
}
.tiny-tag.best {
  color: #7f5e25;
  background: #f0dfa1;
  padding: 5px 7px;
  border-radius: 6px;
}
.tiny-tag.running {
  color: #3d714d;
}
.tiny-tag.locked {
  color: #8b7756;
}
.contract-income {
  color: #3d664b;
  font-weight: 900;
  font-size: 13px;
  margin: 8px 0 4px;
}
.contract-income small {
  font-size: 10px;
  font-weight: 600;
  color: #687c5e;
}
.contract-gain {
  color: #527b3d;
  font-weight: 800;
  font-size: 10px;
  margin: 5px 0;
}
.coder-bonus {
  font-size: 10px;
  color: #6b805e;
  margin: 5px 0;
}
.funding-hint {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  color: #806a3e;
  margin: 9px 0 0;
}
.medal-status {
  display: block;
  margin-top: 9px;
  color: #587445;
  font-size: 9px;
  font-weight: 900;
}
.medal progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 7px;
  accent-color: #80a957;
}
.medal:not(.earned) {
  filter: none;
  opacity: 1;
  background: #e8e8d3;
}
.medal:not(.earned) > span:first-child {
  opacity: 0.7;
}
button:active:not(:disabled) {
  translate: 0 1px;
}
#settings-help {
  margin: 18px 0 12px;
}
@media (max-width: 520px) {
  .job-meta {
    flex-wrap: wrap;
    gap: 7px;
  }
}

.touch-hint {
  display: none;
}
@media (pointer: coarse) {
  .mouse-hint {
    display: none;
  }
  .touch-hint {
    display: inline;
  }
}

/* Mobile cards share rows so changing text and browser chrome cannot overlap them. */
@media (max-width: 800px), (max-width: 1000px) and (max-height: 500px) {
  .game-shell {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto auto minmax(140px, 1fr) auto auto auto auto;
    gap: 8px 6px;
    height: 100dvh;
    min-height: min-content;
    padding: max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
  .hud,
  .world-title,
  .world-status,
  .game-shell > .camera-tools,
  .game-shell > .quest-tracker,
  .game-shell > .expansion,
  .game-shell > .action-dock,
  .build-log,
  .game-shell > .lab-buddy {
    position: static;
    inset: auto;
    transform: none;
    width: auto;
    min-width: 0;
    margin: 0;
  }
  .hud {
    grid-area: 1 / 1 / 2 / -1;
    align-items: center;
  }
  .utility {
    flex-direction: row;
    align-self: center;
  }
  .resources,
  .resource,
  .resource > div {
    min-width: 0;
  }
  .resource strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .world-title {
    grid-area: 2 / 1 / 3 / 11;
    align-self: center;
  }
  .world-title > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .game-shell > .lab-buddy {
    grid-area: 2 / 11 / 3 / -1;
    justify-self: center;
    align-self: center;
    width: 43px;
  }
  .world-status {
    grid-area: 3 / 1 / 4 / 7;
    align-self: center;
    text-align: left;
    font-size: 8px;
    line-height: 1.5;
  }
  .world-status small {
    font-size: 9px;
    margin-top: 2px;
  }
  .game-shell > .camera-tools {
    grid-area: 3 / 7 / 4 / -1;
    justify-self: end;
    align-self: center;
  }
  .camera-tools button {
    min-width: 40px;
    min-height: 44px;
  }
  .game-shell > .world,
  .game-shell.drawer-open > .world {
    grid-area: 4 / 1 / 5 / -1;
    position: relative;
    inset: auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .game-shell > .world > #lab {
    position: relative;
    grid-row: 1;
  }
  .game-shell .world-instruction {
    position: static;
    grid-row: 2;
    transform: none;
    justify-self: center;
    white-space: normal;
    text-align: center;
    font-size: 10px;
    padding: 4px 8px;
  }
  .game-shell > .quest-tracker {
    grid-area: 5 / 1 / 6 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    opacity: 1;
  }
  .quest-top {
    flex: 1;
    min-width: 0;
  }
  .quest-top > div {
    min-width: 0;
  }
  .quest-tracker > button {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 4px;
    min-height: 36px;
    font-size: 11px;
  }
  .game-shell > .expansion {
    grid-area: 6 / 1 / 7 / -1;
    min-height: 48px;
  }
  .game-shell > .action-dock {
    grid-area: 7 / 1 / 8 / -1;
    max-width: none;
    align-self: start;
    justify-self: stretch;
  }
  .action-dock .dock-actions > button {
    flex: 1;
    width: 0;
  }
  .action-dock .build-status > div:first-of-type {
    min-width: 0;
  }
  .action-dock .build-status b {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .action-dock .build-status button {
    flex-shrink: 0;
    min-height: 36px;
  }
  .build-log {
    grid-area: 8 / 1 / 9 / -1;
    align-items: start;
    gap: 10px;
    color: #bdd1b5;
    line-height: 1.4;
    font-size: 11px;
  }
  .build-log p {
    flex: 1;
    max-width: none;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .build-log span {
    flex: 0 0 108px;
    max-width: none;
    text-align: right;
    font-size: 9px;
    color: #a5bea2;
  }
  .game-shell > .control-panel {
    grid-area: 2 / 1 / 7 / -1;
    position: absolute;
    inset: 0;
    width: auto;
    margin-bottom: 8px;
  }
  .game-shell.drawer-open > .camera-tools {
    display: none;
  }
}
@media (max-width: 800px) and (max-height: 640px) {
  .game-shell {
    gap: 6px;
    grid-template-rows: auto auto auto minmax(100px, 1fr) auto auto auto auto;
  }
  .game-shell .world-instruction {
    display: none;
  }
  .action-dock .dock-actions > button {
    min-height: 54px;
  }
  .action-dock .dock-actions > button > small {
    display: none;
  }
}
@media (min-width: 801px) and (max-width: 1000px) and (max-height: 500px) {
  .game-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto auto auto minmax(min-content, 1fr) auto;
    gap: 6px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .game-logo,
  .stars-resource,
  .utility #help,
  .game-shell > .lab-buddy,
  .game-shell .world-instruction,
  .quest-tracker > p,
  .world-title p,
  .journey {
    display: none;
  }
  .resources {
    flex: 1;
    justify-content: flex-start;
  }
  .resource {
    padding: 4px 8px;
  }
  .resource strong {
    font-size: 22px;
  }
  .resource-icon {
    min-width: 32px;
    height: 32px;
    font-size: 20px;
  }
  .game-shell > .world-title {
    grid-area: 2 / 1 / 3 / 6;
  }
  .world-title h1 {
    font-size: 18px;
  }
  .game-shell > .world-status {
    grid-area: 2 / 6 / 3 / 10;
  }
  .game-shell > .camera-tools {
    grid-area: 2 / 10 / 3 / -1;
  }
  .game-shell > .world,
  .game-shell.drawer-open > .world {
    grid-area: 3 / 1 / 6 / 7;
  }
  .game-shell > .quest-tracker {
    grid-area: 3 / 7 / 4 / -1;
  }
  .game-shell > .expansion {
    grid-area: 4 / 7 / 5 / -1;
  }
  .game-shell > .action-dock {
    grid-area: 5 / 7 / 6 / -1;
  }
  .action-dock .dock-actions > button {
    min-height: 48px;
  }
  .action-dock .dock-actions > button > b {
    font-size: 9px;
  }
  .action-dock .dock-actions > button > small {
    display: none;
  }
  .build-log {
    grid-area: 6 / 1 / 7 / -1;
  }
  .game-shell > .control-panel {
    grid-area: 2 / 1 / 6 / 7;
  }
}
@media (max-width: 360px) {
  .resource-icon {
    display: none;
  }
}
