:root {
  color-scheme: dark;
  --bg: #0b1114;
  --panel: #111a1e;
  --line: #253035;
  --muted: #809095;
  --text: #e4eae5;
  --lime: #b7ed8c;
  --cyan: #73c9c2;
  --coral: #e59e87;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 13px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: none;
  border: 0;
  transition:
    background 0.18s,
    color 0.18s,
    transform 0.18s;
}
button:hover {
  color: var(--lime);
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.4;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 88px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(32px, calc((100vw - 1456px) / 2));
  gap: 24px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  letter-spacing: 3px;
  font-weight: 650;
  font-size: 20px;
}
.brand-icon {
  font-size: 44px;
  color: var(--lime);
  line-height: 1;
}
.brand-sub {
  display: block;
  letter-spacing: 3px;
  font-size: 9px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
.version {
  font: 9px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 6px;
  align-self: flex-start;
  margin-top: 5px;
  letter-spacing: 0;
}
.topbar nav {
  height: 100%;
  display: flex;
  gap: 30px;
}
.nav-item {
  height: 100%;
  padding: 0 4px;
  position: relative;
  color: var(--muted);
  font-size: 13px;
}
.nav-item.active {
  color: var(--lime);
}
.nav-item.active:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--lime);
}
.local-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.local-badge i,
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 9px #b7ed8c45;
  display: inline-block;
}
main {
  max-width: 1456px;
  margin: auto;
  padding: 0 32px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 38px 0 30px;
}
.eyebrow {
  font: 9px var(--mono);
  letter-spacing: 2px;
  color: var(--muted);
}
h1 {
  font-weight: 500;
  font-size: 33px;
  letter-spacing: 2px;
  margin: 12px 0 11px;
}
h1 span {
  color: var(--lime);
}
.intro p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  letter-spacing: 1px;
}
.intro-right {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #afbbb8;
  font-size: 12px;
  letter-spacing: 1px;
}
.intro-right small {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  color: var(--muted);
}
.orbital {
  font-size: 40px;
  font-weight: 200;
  color: #4c6657;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 324px;
  gap: 20px;
}
.world-column {
  min-width: 0;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  min-height: 53px;
}
.title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.minor {
  font: 8px var(--mono);
  color: #63777e;
  letter-spacing: 1px;
  font-weight: 400;
  margin-left: 2px;
}
.icon-button {
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 5px;
  font-size: 20px;
}
.icon-button:hover {
  background: #b7ed8c0e;
}
.habitat > .panel-head {
  padding: 9px 18px;
  min-height: 50px;
}
.world-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1.5;
  background: #0b191b;
  overflow: hidden;
}
.world-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}
.world-meta {
  position: absolute;
  top: 20px;
  left: 22px;
  right: 22px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.world-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #a2b8ad;
  background: #0b1719b8;
  padding: 7px 10px;
  border-radius: 4px;
  border: 1px solid #769e7720;
}
.world-label i {
  display: inline-block;
  background: #b5d48d;
  border-radius: 50%;
  height: 4px;
  width: 4px;
  margin: 0 6px 2px 0;
}
#effect-label {
  font-size: 10px;
  color: var(--coral);
  padding-top: 8px;
}
.day-clock {
  position: absolute;
  right: 23px;
  bottom: 25px;
  text-align: right;
  pointer-events: none;
}
.day-clock > span {
  font: 8px var(--mono);
  letter-spacing: 3px;
  color: #8b9b8a;
  display: block;
}
.day-clock b {
  font: 38px var(--mono);
  font-weight: 400;
  color: #deebd2;
  display: block;
  letter-spacing: -2px;
  margin: 2px 0;
}
.day-clock small {
  color: #8d9e8b;
  font-size: 9px;
  letter-spacing: 1px;
}
.scale-mark {
  position: absolute;
  left: 24px;
  bottom: 27px;
  font: 9px var(--mono);
  color: #78928b;
  pointer-events: none;
}
.scale-mark span {
  display: block;
  width: 60px;
  height: 6px;
  border: 1px solid #78928b;
  border-top: 0;
  margin-bottom: 8px;
}
.world-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  text-align: center;
  color: #6e897e;
  font-size: 10px;
  pointer-events: none;
  letter-spacing: 1px;
}
.transport {
  padding: 13px 17px;
  display: flex;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #111b1f;
}
.play-button {
  background: var(--lime);
  color: #17251a;
  min-width: 87px;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.play-button:hover {
  background: #ccf5ab;
  color: #152017;
}
#play-icon {
  margin-right: 5px;
  font-size: 14px;
}
.speed-group {
  display: flex;
  gap: 4px;
}
.speed-group button {
  font: 11px var(--mono);
  color: var(--muted);
  padding: 8px 9px;
  border-radius: 5px;
}
.speed-group button.selected {
  background: #29362d;
  color: var(--lime);
}
.transport-divider {
  height: 18px;
  width: 1px;
  background: var(--line);
}
.text-button {
  color: var(--muted);
  font-size: 11px;
  padding: 5px;
}
.performance {
  margin-left: auto;
  font: 9px var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.perf-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #759c6c;
  border-radius: 50%;
  margin-left: 7px;
}
.population-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.stat-card {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 105px;
  background: #111a1e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 16px;
  gap: 13px;
  overflow: hidden;
}
.stat-symbol {
  font-size: 28px;
  background: #b7ed8c0a;
  border: 1px solid #b7ed8c15;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plant-stat .stat-symbol,
.plant-color {
  color: var(--lime);
}
.herb-stat .stat-symbol,
.herb-color {
  color: var(--cyan);
}
.carn-stat .stat-symbol,
.carn-color {
  color: var(--coral);
}
.stat-card div > span {
  display: block;
  font-size: 10px;
  color: #adbbb5;
}
.stat-card small {
  font: 7px var(--mono);
  color: #677d80;
  margin-left: 5px;
}
.stat-card strong {
  font: 29px var(--mono);
  display: block;
  margin-top: 5px;
}
.stat-trend {
  position: absolute;
  font-size: 8px;
  right: 12px;
  bottom: 13px;
  color: #5c7472;
}
.chart-panel .panel-head {
  padding-bottom: 10px;
}
.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 9px;
}
.chart-container {
  height: 172px;
  padding: 0 16px;
}
.chart-container canvas,
.gene-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 20px 15px;
  font-size: 9px;
  color: #6f8587;
}
.chart-foot b {
  font-weight: 400;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tiny-tag {
  font-size: 8px;
  color: #a1b99c;
  padding: 3px 7px;
  border: 1px solid #68816c40;
  border-radius: 4px;
}
.sliders {
  padding: 0 20px;
}
.slider-field {
  margin: 2px 0 20px;
}
.slider-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.slider-field label > span {
  color: #8c9a8d;
}
.slider-field b {
  font-weight: 400;
  color: #c1ccc4;
  margin-left: 7px;
}
.slider-field output {
  font: 11px var(--mono);
  color: var(--lime);
}
input[type="range"] {
  width: 100%;
  height: 3px;
  margin: 17px 0 11px;
  appearance: none;
  background: linear-gradient(to right, #99bd7c 50%, #2c3a35 50%);
  border-radius: 5px;
  cursor: pointer;
  display: block;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border: 2px solid #111a1e;
  border-radius: 50%;
  background: #b7ed8c;
  box-shadow: 0 0 0 1px #8dab77;
}
input[type="range"]::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 2px solid #111a1e;
  border-radius: 50%;
  background: #b7ed8c;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #677c7c;
}
.seed-field {
  border-top: 1px solid var(--line);
  padding: 15px 20px 16px;
}
.seed-field label {
  font-size: 10px;
  color: #b6c2b9;
  display: block;
  margin-bottom: 9px;
}
.seed-field label span {
  font: 8px var(--mono);
  color: #627a7b;
  margin-left: 6px;
}
.seed-field > div {
  display: flex;
  border: 1px solid #30403e;
  border-radius: 5px;
  background: #0d171b;
  padding: 2px 4px 2px 10px;
}
.seed-field input {
  background: transparent;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #b3c2b7;
  font: 10px var(--mono);
  letter-spacing: 1px;
  flex: 1;
}
.seed-field small {
  display: block;
  color: #5e7575;
  font-size: 8px;
  margin-top: 8px;
}
.intervention-panel .panel-head {
  padding-bottom: 4px;
}
.butterfly {
  color: #8d9a79;
  font-size: 23px;
}
.intervention-panel > p {
  font-size: 10px;
  color: var(--muted);
  margin: 5px 20px 15px;
}
.disaster-buttons {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
}
.disaster-buttons button {
  flex: 1;
  border: 1px solid #3b3730;
  border-radius: 6px;
  padding: 9px 5px;
  font-size: 10px;
  color: #c2b29c;
  background: #b7a07805;
}
.disaster-buttons button:hover {
  border-color: #b6a17d;
  background: #b7a07815;
}
.disaster-buttons span {
  font-size: 14px;
  vertical-align: middle;
  margin-right: 3px;
}
.introduce-row {
  border-top: 1px solid var(--line);
  padding: 12px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
}
.introduce-row > span {
  color: #7b9090;
}
.introduce-row button {
  font-size: 9px;
  padding: 5px 3px;
  color: #adc0a7;
}
.generation-badge {
  font: 10px var(--mono);
  color: var(--lime);
  border: 1px solid #a9d17c40;
  padding: 3px 6px;
  border-radius: 3px;
}
.evolution-panel .panel-head {
  padding-bottom: 12px;
}
.gene-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 20px;
  margin-bottom: 12px;
  font-size: 9px;
  color: #8fa19e;
}
.gene-row > span {
  width: 76px;
  flex-shrink: 0;
}
.gene-row > div {
  flex: 1;
  background: #283730;
  border-radius: 2px;
  height: 3px;
}
.gene-row i {
  display: block;
  width: 62.5%;
  height: 100%;
  background: #96b97a;
  border-radius: 2px;
}
.gene-row b {
  font: 9px var(--mono);
  width: 28px;
  color: #b5c4b5;
  text-align: right;
}
.life-totals {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 8px;
  color: #738886;
}
.life-totals b {
  font-weight: 400;
  color: #c3cec3;
  margin-left: 5px;
}
.timeline-panel {
  flex: 1;
  min-height: 151px;
}
.timeline-panel .panel-head {
  padding-bottom: 9px;
}
.small {
  font-size: 9px;
}
.events {
  padding: 0 20px 12px;
}
.event {
  position: relative;
  padding: 0 0 12px 15px;
  border-left: 1px solid #314237;
  margin-left: 3px;
}
.event:before {
  content: "";
  position: absolute;
  left: -3px;
  top: 4px;
  width: 5px;
  height: 5px;
  background: #8aa575;
  border-radius: 50%;
}
.event:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}
.event > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.event h4 {
  font-size: 10px;
  font-weight: 400;
  margin: 0;
  color: #b9c5b9;
}
.event time {
  font: 8px var(--mono);
  color: #718780;
  white-space: nowrap;
}
.event p {
  font-size: 9px;
  line-height: 1.7;
  color: #677e7a;
  margin: 5px 0 0;
}
.event.disaster:before,
.event.extinction:before {
  background: var(--coral);
}
.save-row {
  display: flex;
  gap: 8px;
}
.save-row > button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 10px;
  color: #a2b3ac;
  flex: 1;
  white-space: nowrap;
}
.save-row .icon-button {
  flex: 0;
  min-width: 30px;
  padding: 5px;
  font-size: 18px;
}
.local-note {
  text-align: center;
  font-size: 8px;
  color: #617977;
  margin-top: -6px;
}
.observation-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 0 34px;
  color: #6a817c;
  font-size: 10px;
}
.observation-note > span:first-child {
  color: #899e74;
  font-size: 15px;
}
.observation-note p {
  margin: 0;
}
.observation-note > span:last-child {
  margin-left: auto;
  font: 8px var(--mono);
  letter-spacing: 1px;
  white-space: nowrap;
}
footer {
  max-width: 1392px;
  margin: 0 auto;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: #5e7674;
  font: 8px var(--mono);
  letter-spacing: 1px;
}
footer b {
  font-family: inherit;
  font-weight: 400;
  margin-left: 18px;
  letter-spacing: 1px;
}
footer > span:first-child {
  color: #8da38c;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #c0ed9c;
  color: #172717;
  border: 1px solid #d3f7b9;
  box-shadow: 0 10px 40px #0006;
  padding: 13px 22px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  max-width: 90vw;
  width: max-content;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.inspector {
  position: absolute;
  top: 70px;
  left: 22px;
  width: 236px;
  background: #111c20ed;
  backdrop-filter: blur(12px);
  border: 1px solid #5b77685c;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 24px #0003;
}
.inspector > button {
  float: right;
  font-size: 20px;
  color: #8e9b90;
  margin-top: -8px;
  margin-right: -8px;
}
.inspector .eyebrow {
  font-size: 7px;
  letter-spacing: 1px;
}
.inspector h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 12px 0;
  color: #c8e6c1;
}
.inspect-line {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 10px;
  color: #9baea1;
}
.inspect-line b {
  font: 10px var(--mono);
  color: #d0dfc9;
}
.inspect-energy {
  background: #2b3c31;
  height: 3px;
  margin: 7px 0 10px;
}
.inspect-energy i {
  background: var(--lime);
  height: 100%;
  display: block;
}
.archive-heading {
  padding: 15px 0 35px;
}
.archive-heading h2 {
  font-size: 26px;
  font-weight: 400;
  margin: 16px 0;
}
.archive-heading p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 12px;
}
.archive-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}
.archive-stats {
  padding: 25px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.archive-stats span {
  font-size: 11px;
  color: var(--muted);
}
.archive-stats strong {
  font: 30px var(--mono);
  display: block;
  margin-top: 9px;
  color: var(--lime);
}
.gene-chart-wrap {
  height: 210px;
  padding: 0 20px;
}
.gene-legend {
  justify-content: center;
  padding: 15px;
}
.archive-events {
  margin: 20px 0 40px;
}
.archive-events .event {
  margin: 8px 25px;
  padding-bottom: 24px;
}
.archive-events .event h4 {
  font-size: 13px;
}
.archive-events .event p {
  font-size: 11px;
}
.archive-events .event time {
  font-size: 10px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.guide-card {
  padding: 28px;
}
.guide-card > span {
  color: var(--lime);
  font: 10px var(--mono);
}
.guide-card h3 {
  font-size: 18px;
  font-weight: 400;
  margin: 20px 0 15px;
  line-height: 1.6;
}
.guide-card p {
  color: #8fa29b;
  font-size: 12px;
  line-height: 2;
}
.guide-footer {
  text-align: center;
  padding: 35px 10px 50px;
  font-size: 11px;
  color: var(--muted);
}
dialog {
  background: #152024;
  border: 1px solid #3c5145;
  border-radius: 14px;
  color: var(--text);
  max-width: 420px;
  padding: 30px;
}
dialog::backdrop {
  background: #030809bb;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-weight: 400;
  font-size: 22px;
  margin: 18px 0;
}
dialog p {
  color: #8fa29b;
  line-height: 1.9;
  font-size: 12px;
}
dialog form > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
dialog button {
  border: 1px solid #3b4d43;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 12px;
}
dialog button.primary {
  background: var(--lime);
  color: #192b17;
  border-color: var(--lime);
}
.habitat:fullscreen {
  display: flex;
  flex-direction: column;
  border-radius: 0;
  background: #0b191b;
}
.habitat:fullscreen .world-wrap {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.habitat:fullscreen .world-wrap canvas {
  height: 100%;
}
.habitat:fullscreen .panel-head {
  flex-shrink: 0;
}
.habitat:fullscreen .transport {
  flex-shrink: 0;
}
@media (min-width: 1500px) {
  .world-wrap {
    aspect-ratio: 1.5;
  }
  .chart-container {
    height: 204px;
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 14px;
  }
  .minor {
    font-size: 7px;
  }
  .title {
    font-size: 11px;
  }
  .stat-card {
    padding: 15px 11px;
    gap: 8px;
  }
  .stat-card small {
    display: none;
  }
  .stat-symbol {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }
  .stat-trend {
    font-size: 7px;
  }
  .world-wrap {
    aspect-ratio: 1.5;
  }
  .intro-right {
    display: none;
  }
  .transport {
    gap: 10px;
  }
  .speed-group button {
    padding: 8px 6px;
  }
  .panel-head {
    padding: 16px;
  }
  .chart-legend {
    gap: 8px;
    font-size: 8px;
  }
  .version {
    display: none;
  }
  .world-hint {
    font-size: 8px;
  }
  .day-clock b {
    font-size: 30px;
  }
  .topbar nav {
    gap: 20px;
  }
}
@media (max-width: 850px) {
  .topbar {
    height: 73px;
    padding: 0 20px;
    gap: 12px;
  }
  .brand {
    font-size: 17px;
    gap: 8px;
  }
  .brand-icon {
    font-size: 35px;
  }
  .brand-sub {
    font-size: 8px;
    letter-spacing: 2px;
  }
  .local-badge {
    display: none;
  }
  main {
    padding: 0 20px;
  }
  .intro {
    padding: 28px 0 25px;
  }
  .intro h1 {
    font-size: 28px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .world-wrap {
    aspect-ratio: 1.5;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
  .control-panel {
    grid-row: span 2;
  }
  .timeline-panel {
    min-height: 150px;
  }
  .save-row,
  .local-note {
    grid-column: 1/-1;
  }
  .save-row {
    justify-content: center;
  }
  .save-row > button {
    max-width: 180px;
  }
  .local-note {
    margin-top: -5px;
  }
  .observation-note {
    padding: 25px 0;
  }
  .chart-container {
    height: 170px;
  }
  .stat-card {
    min-height: 100px;
    padding: 18px;
  }
  .stat-symbol {
    width: 40px;
    height: 40px;
  }
  .stat-card small {
    display: inline;
  }
  .stat-trend {
    font-size: 8px;
  }
  footer {
    margin: 0 20px;
    padding: 20px 0;
  }
  footer > span:last-child {
    font-size: 7px;
  }
  .guide-grid {
    grid-template-columns: 1fr 1fr;
  }
  .archive-grid {
    grid-template-columns: 1fr;
  }
  .archive-stats {
    grid-template-columns: repeat(4, 1fr);
  }
  .chart-legend {
    font-size: 9px;
  }
  .title {
    font-size: 12px;
  }
  .minor {
    font-size: 8px;
  }
}
@media (max-width: 520px) {
  .topbar {
    padding: 0 16px;
    height: 70px;
  }
  .brand {
    font-size: 15px;
    letter-spacing: 2px;
  }
  .brand-icon {
    font-size: 31px;
  }
  .brand-sub {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .topbar nav {
    gap: 15px;
  }
  .nav-item {
    font-size: 11px;
    padding: 0;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 1.6px;
  }
  main {
    padding: 0 12px;
  }
  .intro {
    padding: 27px 5px 24px;
  }
  h1 {
    font-size: 27px !important;
    margin: 10px 0;
  }
  .intro p {
    font-size: 10px;
    letter-spacing: 0.6px;
  }
  .world-wrap {
    aspect-ratio: 1.5;
  }
  .world-meta {
    top: 14px;
    left: 14px;
    right: 14px;
  }
  .world-label {
    font-size: 8px;
    padding: 6px 8px;
  }
  .habitat > .panel-head {
    padding: 8px 12px;
    min-height: 45px;
  }
  .minor {
    font-size: 7px;
    letter-spacing: 0.5px;
  }
  .transport {
    padding: 11px;
    gap: 9px;
  }
  .play-button {
    min-width: 67px;
    padding: 8px 9px;
    font-size: 10px;
  }
  .speed-group {
    gap: 2px;
  }
  .speed-group button {
    font-size: 10px;
    padding: 8px 7px;
  }
  .transport-divider {
    display: none;
  }
  .transport #reset {
    padding: 4px;
  }
  .transport #reset span {
    display: none;
  }
  .performance {
    font-size: 8px;
  }
  .perf-dot {
    margin-left: 3px;
  }
  .day-clock {
    right: 16px;
    bottom: 21px;
  }
  .day-clock b {
    font-size: 32px;
  }
  .world-hint {
    bottom: 23px;
    left: 55px;
    right: 75px;
    font-size: 8px;
    line-height: 1.7;
  }
  .scale-mark {
    left: 16px;
    bottom: 23px;
    font-size: 7px;
  }
  .scale-mark span {
    width: 35px;
  }
  .population-cards {
    gap: 7px;
    margin: 11px 0;
  }
  .stat-card {
    padding: 15px 10px;
    min-height: 92px;
    gap: 8px;
    align-items: flex-start;
  }
  .stat-symbol {
    font-size: 16px;
    width: 21px;
    height: 21px;
    border: 0;
    background: none;
    margin-top: 2px;
  }
  .stat-card div > span {
    font-size: 9px;
  }
  .stat-card strong {
    font-size: 25px;
    margin-top: 9px;
  }
  .stat-card small {
    display: none;
  }
  .stat-trend {
    display: none;
  }
  .chart-panel .panel-head {
    padding: 17px 13px 12px;
  }
  .chart-legend {
    font-size: 8px;
    gap: 10px;
  }
  .chart-container {
    padding: 0 9px;
    height: 150px;
  }
  .chart-foot {
    font-size: 8px;
    padding: 10px 13px 14px;
  }
  .chart-foot > span:last-child {
    display: none;
  }
  .sidebar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .control-panel {
    grid-row: auto;
  }
  .control-panel .sliders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .slider-field {
    margin-bottom: 4px;
  }
  .slider-field:last-child {
    grid-column: 1/-1;
    margin: 4px 0 14px;
  }
  .seed-field {
    padding-top: 13px;
  }
  .slider-field label {
    font-size: 10px;
  }
  .slider-field output {
    font-size: 10px;
  }
  .slider-field b {
    margin-left: 4px;
  }
  .intervention-panel > p {
    font-size: 11px;
  }
  .disaster-buttons button {
    font-size: 12px;
    padding: 12px;
  }
  .introduce-row {
    padding: 12px 20px;
    font-size: 10px;
  }
  .introduce-row button {
    font-size: 10px;
    padding: 6px;
  }
  .evolution-panel .gene-row {
    font-size: 10px;
    margin-bottom: 16px;
  }
  .gene-row > span {
    width: 100px;
  }
  .life-totals {
    font-size: 10px;
    padding: 14px 20px;
  }
  .timeline-panel {
    min-height: 160px;
  }
  .event h4 {
    font-size: 11px;
  }
  .event p {
    font-size: 10px;
  }
  .save-row {
    gap: 6px;
  }
  .save-row > button {
    font-size: 11px;
    padding: 12px;
  }
  .local-note {
    font-size: 9px;
    margin: 0;
  }
  .observation-note {
    padding: 25px 4px;
    gap: 9px;
  }
  .observation-note p {
    font-size: 9px;
    line-height: 1.8;
  }
  .observation-note > span:last-child {
    display: none;
  }
  footer {
    margin: 0 16px;
    padding: 20px 0 28px;
  }
  footer > span:first-child {
    font-size: 8px;
  }
  footer > span:last-child {
    display: none;
  }
  footer b {
    font-size: 8px;
    margin-left: 10px;
  }
  .inspector {
    top: 56px;
    left: 13px;
    width: 220px;
  }
  .archive-heading {
    padding: 10px 5px 20px;
  }
  .archive-heading h2 {
    font-size: 22px;
    line-height: 1.6;
  }
  .archive-heading p {
    font-size: 11px;
  }
  .archive-stats {
    grid-template-columns: 1fr 1fr;
  }
  .guide-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .guide-card {
    padding: 25px;
  }
  .guide-footer {
    font-size: 10px;
    line-height: 2;
  }
  .gene-chart-wrap {
    padding: 0 10px;
  }
  .archive-events .event {
    margin-left: 20px;
    margin-right: 20px;
  }
  dialog {
    max-width: calc(100vw - 32px);
    padding: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
