:root {
  color-scheme: dark;
  font-family: "Inter Variable", sans-serif;
  color: #d6ece4;
  background: #041519;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  touch-action: none;
}
button,
input {
  font: inherit;
}
button {
  min-height: 44px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid #9cf1d3;
  outline-offset: 4px;
}
button:hover {
  color: #ffcf8e;
}
.mast,
.top-controls,
.title,
.legend,
.colony-data,
.controls,
.panel,
.hint,
.note {
  position: fixed;
  z-index: 2;
}
.mast {
  left: 44px;
  top: 35px;
  display: flex;
  gap: 15px;
  align-items: center;
  pointer-events: none;
}
.emblem {
  font-size: 39px;
  color: #f4c57f;
}
.mast h1 {
  font:
    500 22px "Space Grotesk Variable",
    sans-serif;
  letter-spacing: 0.22em;
  margin: 0 0 5px;
}
.mast div > span {
  font:
    9px "JetBrains Mono Variable",
    monospace;
  letter-spacing: 0.15em;
  color: #97bfb5;
}
.top-controls {
  right: 44px;
  top: 36px;
  display: flex;
  align-items: center;
  gap: 25px;
}
.status {
  font:
    9px "JetBrains Mono Variable",
    monospace;
  letter-spacing: 0.11em;
  color: #b4d1c4;
}
.top-controls button {
  border: 1px solid #8bbda066;
  border-radius: 24px;
  padding: 0 18px;
  font-size: 11px;
  background: #04151988;
}
.title {
  left: 46px;
  bottom: 164px;
  pointer-events: none;
}
.title p {
  margin: 0 0 15px;
  font:
    clamp(30px, 3.5vw, 51px)/1.04 "Instrument Serif",
    serif;
  letter-spacing: -0.025em;
}
.title em {
  color: #e7bd83;
}
.title > span {
  font-size: 11px;
  color: #a6c8bd;
}
.legend {
  left: 48px;
  bottom: 100px;
  display: flex;
  gap: 20px;
  font:
    9px "JetBrains Mono Variable",
    monospace;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend i {
  display: block;
  width: 20px;
  height: 2px;
}
.amber {
  background: #f8ba63;
  box-shadow: 0 0 6px #f8ba63;
}
.mint {
  background: #70e6ce;
  box-shadow: 0 0 6px #70e6ce;
}
.colony-data {
  right: 48px;
  bottom: 168px;
  display: flex;
  gap: 40px;
  pointer-events: none;
}
.colony-data div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.colony-data strong {
  font:
    300 41px "Space Grotesk Variable",
    sans-serif;
  color: #d5ecd7;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.colony-data span {
  font:
    9px "JetBrains Mono Variable",
    monospace;
  color: #a9c6b7;
  letter-spacing: 0.08em;
}
.controls {
  right: 44px;
  bottom: 88px;
  display: flex;
  gap: 10px;
}
.controls button {
  border-radius: 7px;
  border: 1px solid #6b8e7655;
  background: #092426d9;
  padding: 0 17px;
  font-size: 12px;
}
.controls button:first-child {
  background: #ffe9bd;
  color: #18322d;
  font-weight: 600;
}
.controls button[aria-pressed="true"] {
  background: #a7e9c9;
}
.controls span {
  margin-left: 12px;
}
.note {
  left: 47px;
  bottom: 34px;
  margin: 0;
  color: #93b5a8;
  font-size: 10px;
  pointer-events: none;
}
.panel {
  right: 44px;
  bottom: 147px;
  width: 300px;
  background: #092d2dec;
  border: 1px solid #729f8a66;
  border-radius: 12px;
  padding: 18px;
  backdrop-filter: blur(15px);
}
.panel label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.panel output {
  color: #b9dfcb;
}
.panel input {
  width: 100%;
  height: 44px;
  accent-color: #d3c598;
}
.panel > div {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.panel #close {
  color: #ebd1a0;
}
.hint {
  left: 50%;
  top: 111px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  background: #143a32e8;
  color: #d9f7df;
  border: 1px solid #719e7c;
  padding: 14px 20px;
  border-radius: 30px;
  pointer-events: none;
}
[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  .mast {
    left: 20px;
    top: 25px;
    gap: 10px;
  }
  .emblem {
    font-size: 31px;
  }
  .mast h1 {
    font-size: 18px;
  }
  .mast div > span {
    font-size: 8px;
  }
  .top-controls {
    right: 19px;
    top: 27px;
  }
  .status {
    display: none;
  }
  .top-controls button {
    padding: 0 14px;
  }
  .title {
    left: 23px;
    top: 122px;
    bottom: auto;
  }
  .title p {
    font-size: 32px;
    margin-bottom: 11px;
  }
  .title > span {
    font-size: 10px;
  }
  .legend {
    left: 23px;
    bottom: 170px;
    gap: 16px;
    font-size: 8px;
  }
  .legend i {
    width: 13px;
  }
  .colony-data {
    right: 23px;
    bottom: 159px;
    gap: 18px;
  }
  .colony-data strong {
    font-size: 25px;
  }
  .colony-data span {
    font-size: 7px;
  }
  .colony-data div {
    gap: 3px;
  }
  .controls {
    left: 20px;
    right: 20px;
    bottom: 83px;
    gap: 8px;
  }
  .controls button {
    padding: 0 11px;
    flex: 1;
    font-size: 11px;
    white-space: nowrap;
  }
  .controls button:first-child {
    flex: 1.3;
  }
  .note {
    left: 23px;
    bottom: 40px;
    font-size: 9px;
  }
  .panel {
    left: 20px;
    right: 20px;
    width: auto;
    bottom: 143px;
  }
  .hint {
    top: 88px;
    font-size: 10px;
    padding: 12px 15px;
    max-width: 95%;
  }
}
@media (max-height: 580px) {
  .title {
    display: none;
  }
  .colony-data {
    bottom: 110px;
  }
  .controls {
    bottom: 40px;
  }
  .legend {
    bottom: 85px;
  }
  .note {
    bottom: 12px;
  }
}
/* Small labels remain legible; the phone legend stacks beside the counters. */
.mast div > span,
.status,
.legend,
.colony-data span,
.note {
  font-size: 11px;
}
.top-controls button,
.panel > div {
  font-size: 12px;
}
@media (max-width: 650px) {
  .mast div > span {
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  .title > span,
  .note {
    font-size: 11px;
  }
  .legend {
    font-size: 11px;
    flex-direction: column;
    gap: 9px;
    bottom: 161px;
  }
  .colony-data {
    gap: 16px;
    bottom: 158px;
  }
  .colony-data span {
    font-size: 11px;
    letter-spacing: 0;
  }
  .controls button {
    font-size: 12px;
  }
  .hint {
    font-size: 11px;
  }
}
