:root {
  color-scheme: dark;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
  background: #000;
  color: #e0dcc1;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  display: grid;
  place-items: center;
}
button,
input {
  font: inherit;
}
button {
  touch-action: manipulation;
  color: #d0dd9a;
  background: linear-gradient(#393e3a, #161c1a 48%, #101413 50%, #222924);
  border: 1px solid #666754;
  box-shadow:
    inset 1px 1px #8a8a72,
    inset -1px -1px #030503;
  border-radius: 0;
  cursor: pointer;
  text-shadow: 1px 1px #000;
  padding: 0.5em 0.8em;
}
button:hover:not(:disabled) {
  border-color: #cdd896;
  filter: brightness(1.2);
}
button:active:not(:disabled) {
  box-shadow: inset 2px 2px #050807;
}
button:disabled {
  color: #666e62;
  cursor: default;
  filter: grayscale(0.85);
}
button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid #e0c476;
  outline-offset: 2px;
}
button.primary {
  color: #fcdf7a;
  border-color: #af9259;
}
input {
  color: #d5e3c3;
  background: #080d0b;
  border: 1px solid #686b52;
  box-shadow: inset 2px 2px #000;
  padding: 0.6em;
  min-width: 0;
}
h1,
h2,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
#screen {
  width: min(100vw, 133.333333dvh);
  aspect-ratio: 4/3;
  position: relative;
  container-type: inline-size;
  overflow: hidden;
  background: #060909;
  font-size: 1.35cqw;
  isolation: isolate;
}
#game {
  position: absolute;
  inset: 0;
}
#field {
  position: absolute;
  inset: 0 0 25%;
  overflow: hidden;
}
#board {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
#stage,
#connection {
  pointer-events: none;
  user-select: none;
}
#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5.6%;
  background: linear-gradient(#060c0bea, #10171ac4);
  display: flex;
  align-items: center;
  gap: 1.4%;
  padding: 0 0.9%;
  font-size: 1.35cqw;
  text-shadow: 1px 1px #000;
  pointer-events: none;
  border-bottom: 1px solid #3a49434a;
}
#topbar button {
  pointer-events: auto;
  font-size: 1.1cqw;
  padding: 0.25em 0.8em;
}
#stage {
  color: #d7cf96;
  max-width: 35%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#timer {
  color: #eee0b0;
  font-variant-numeric: tabular-nums;
  min-width: 4.8%;
}
.resources {
  margin-left: auto;
  display: flex;
  gap: 2.2cqw;
  white-space: nowrap;
  font-size: 1.4cqw;
}
.resources b {
  font-weight: normal;
  color: #8ffa87;
  font-variant-numeric: tabular-nums;
}
.mineral {
  color: #8ac6ef;
}
.gas {
  color: #64cb93;
}
.supply {
  color: #ddd998;
}
#leaderboard {
  position: absolute;
  top: 8.8%;
  left: 1.8%;
  width: 19%;
  font-size: 1.24cqw;
  color: #f4e3a8;
  text-shadow:
    1px 1px #000,
    -1px -1px #172021;
  pointer-events: none;
}
#leaderboard .score-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6cqw;
  line-height: 1.7;
}
#leaderboard .score-row span:first-child {
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#leaderboard .score-heading {
  font-size: 1.08cqw;
  color: #b6c5c7;
  border-bottom: 1px solid #82928380;
  margin-bottom: 0.4cqw;
}
#announcements {
  position: absolute;
  left: 2%;
  bottom: 13%;
  max-width: 80%;
  white-space: pre-line;
  color: #a5f69e;
  font-size: 1.4cqw;
  line-height: 1.5;
  text-shadow:
    1px 1px #000,
    -1px -1px #000;
  pointer-events: none;
}
#order-prompt {
  position: absolute;
  bottom: 3%;
  left: 2%;
  color: #ffffa2;
  text-shadow: 1px 1px #000;
  font-size: 1.35cqw;
  pointer-events: none;
}
#connection {
  position: absolute;
  top: 7%;
  right: 1.5%;
  font-size: 1.2cqw;
  color: #ffd275;
  background: #180e03dd;
  padding: 0.5em;
}
#error {
  position: absolute;
  bottom: 26.5%;
  left: 2%;
  max-width: 92%;
  color: #ffc078;
  font-size: 1.4cqw;
  text-shadow: 1px 1px #000;
  pointer-events: none;
  z-index: 8;
}
#error:empty {
  display: none;
}
#hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 25%;
  background: repeating-linear-gradient(0deg, #202726 0px, #202726 2px, #252d2b 3px, #262f2d 4px);
  border-top: 0.4cqw solid #0a0f0e;
  box-shadow:
    inset 0 0.35cqw #65716a,
    inset 0 0.75cqw #343f39,
    inset 0 -0.7cqw #090e0d;
  color: #bbd292;
}
.hud-ridge {
  position: absolute;
  top: 0;
  left: 22%;
  width: 54%;
  height: 10%;
  background: linear-gradient(#768279, #28332e 40%, #141e19 65%, #39463d);
  clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
}
.hud-bolts {
  position: absolute;
  inset: 4% 0.3% 4%;
  border-left: 0.8cqw ridge #414941;
  border-right: 0.8cqw ridge #414941;
  pointer-events: none;
}
#map-panel {
  position: absolute;
  left: 1.4%;
  top: 9%;
  width: 20%;
  height: 83%;
  padding: 0.35cqw;
  border: 0.35cqw ridge #586153;
  background: #010605;
  box-shadow: 0 0 0 0.15cqw #0a100c;
}
#minimap {
  width: 100%;
  height: 86%;
  display: block;
  cursor: crosshair;
  touch-action: none;
  image-rendering: pixelated;
}
#map-players {
  display: flex;
  gap: 0.3cqw;
  height: 14%;
  padding-top: 0.3cqw;
}
#map-players button {
  padding: 0;
  width: 25%;
  font-size: 1.05cqw;
  line-height: 1;
}
#map-players button.active {
  color: #fff4c8;
  border-color: #aeae73;
}
#selection-panel {
  position: absolute;
  left: 24%;
  width: 36.8%;
  top: 13%;
  height: 78%;
  background: #09120ee8;
  border: 0.18cqw solid #111915;
  box-shadow: inset 0 0 1.5cqw #000;
  padding: 1cqw;
}
#selection-title {
  color: #e0e1b3;
  text-align: center;
  font-size: 1.4cqw;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 0.6cqw;
}
#selection-stats {
  font-size: 1.2cqw;
  color: #a1dba1;
  white-space: pre-line;
  line-height: 1.8;
  text-align: center;
}
#selection-extra {
  font-size: 1.05cqw;
  color: #a4ae92;
  text-align: center;
  margin-top: 0.5cqw;
}
#selection-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35cqw;
}
#selection-grid:empty {
  display: none;
}
#selection-grid button {
  padding: 0.15cqw;
  min-width: 0;
  height: 3.7cqw;
  position: relative;
  border: 1px solid #4a754c;
  background: #06130c;
}
#selection-grid canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
#selection-grid button::after {
  content: "";
  position: absolute;
  bottom: 0.18cqw;
  left: 10%;
  right: 10%;
  height: 0.15cqw;
  background: #64cd64;
}
#portrait-frame {
  position: absolute;
  left: 63%;
  width: 13.2%;
  top: 8%;
  height: 84%;
  border: 0.5cqw ridge #64705d;
  background: repeating-linear-gradient(0deg, #021006 0, #031207 3px, #07190b 4px);
  box-shadow:
    0 0 0 0.2cqw #080d08,
    inset 0 0 1.7cqw #000;
  overflow: hidden;
}
#portrait {
  width: 100%;
  height: 86%;
  display: block;
  image-rendering: pixelated;
}
#portrait-label {
  display: block;
  text-align: center;
  white-space: nowrap;
  font-size: 1.05cqw;
  color: #8fbc8b;
  text-shadow: 1px 1px #000;
}
#commands {
  position: absolute;
  left: 78%;
  top: 8%;
  width: 20.5%;
  height: 84%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0.48cqw;
  padding: 0.32cqw;
  border: 0.26cqw ridge #5d654f;
  background: #070e0b;
}
#commands button {
  min-width: 0;
  position: relative;
  padding: 0.12cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.94cqw;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.3;
}
#commands button .cmd-icon {
  font-family: Arial, sans-serif;
  font-size: 2.25cqw;
  line-height: 1;
  color: #b9d9a1;
  text-shadow: 0 0 0.5cqw #57a987;
}
#commands button kbd {
  position: absolute;
  right: 0.18cqw;
  top: 0.05cqw;
  font: 0.85cqw monospace;
  color: #f7d779;
}
#commands button[data-empty="true"] {
  pointer-events: none;
  background: #0c1610;
  border-color: #242e23;
  box-shadow: inset 1px 1px #000;
}
#commands button[aria-pressed="true"] {
  border-color: #e8d878;
  background: #344632;
}
#tooltip {
  position: absolute;
  right: 1%;
  bottom: 110%;
  max-width: 38%;
  background: #08100ef0;
  border: 1px solid #a4a56c;
  padding: 0.6cqw 0.85cqw;
  color: #e1ddb3;
  font-size: 1.2cqw;
  line-height: 1.6;
  white-space: pre-line;
  pointer-events: none;
  text-shadow: 1px 1px #000;
}
#tooltip:empty {
  display: none;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000a;
}
.lobby {
  background: radial-gradient(ellipse at center, #263333, #101b20 55%, #040809);
  background-size: 100% 100%;
}
.window {
  background: linear-gradient(125deg, #25302e, #101a18 70%);
  border: 0.4cqw ridge #69715b;
  box-shadow:
    0 0.6cqw 3cqw #000,
    inset 0 0 0 0.35cqw #080f0b;
  padding: 2.4cqw;
}
.window h1,
.window h2 {
  color: #e5dab0;
  font-weight: 400;
  text-shadow: 2px 2px #000;
}
.window h1 {
  font-size: 2.7cqw;
  margin-bottom: 2cqw;
}
.window h1 small {
  display: block;
  font-size: 1.15cqw;
  color: #8ea68d;
  letter-spacing: 0.18em;
  margin-top: 0.5em;
}
.window h2 {
  font-size: 2cqw;
  margin-bottom: 1.5cqw;
}
.lobby-window {
  width: 66%;
  font-size: 1.35cqw;
}
.lobby-window > label {
  margin-right: 1cqw;
}
.menu-actions {
  display: flex;
  gap: 0.75cqw;
  margin: 1.8cqw 0;
  flex-wrap: wrap;
}
.join-row {
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  margin: 1.6cqw 0;
}
.join-row input {
  flex: 1;
  text-transform: uppercase;
}
.rooms {
  margin: 1cqw 0;
  max-height: 18cqw;
  overflow: auto;
}
.room-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1cqw;
  border-bottom: 1px solid #4b5548;
  padding: 0.5cqw 0;
}
.menu-window {
  width: 32%;
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  font-size: 1.35cqw;
}
.menu-window h2 {
  text-align: center;
}
.help-window {
  width: 78%;
  font-size: 1.45cqw;
}
.help-window dl {
  display: grid;
  grid-template-columns: 10% 1fr;
  gap: 1.1cqw;
  margin: 1cqw 0 2cqw;
}
.help-window dt {
  color: #b0ce9b;
}
.help-window dd {
  margin: 0;
  color: #d1d8c1;
  line-height: 1.6;
}
.result {
  position: absolute;
  left: 28%;
  top: 32%;
  width: 44%;
  z-index: 3;
  text-align: center;
  font-size: 1.5cqw;
}
.result p {
  line-height: 1.6;
  margin: 1.2cqw 0;
}
.result button {
  margin: 0.5cqw;
}
.member {
  padding: 0.8cqw 0;
  border-bottom: 1px solid #425140;
  display: flex;
  justify-content: space-between;
}
#screen:has(#lobby:not([hidden])) #error,
#screen:has(#party:not([hidden])) #error {
  bottom: 10%;
  left: 17%;
  max-width: 66%;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
#commands .command-icon {
  font-family: Arial, sans-serif;
  font-size: 2.25cqw;
  line-height: 1.1;
  color: #b9d9a1;
  text-shadow: 0 0 0.5cqw #57a987;
}
#commands .command-name {
  font-size: 0.94cqw;
}
.score {
  line-height: 1.8;
  white-space: nowrap;
}
.player-0 {
  color: #f46b59 !important;
}
.player-1 {
  color: #78abff !important;
}
.player-2 {
  color: #c797ef !important;
}
.player-3 {
  color: #edbd70 !important;
}
.unit-icon {
  font-size: 1.6cqw;
}
.family-ghost {
  color: #e7ba6c;
}
.family-dragoon {
  color: #9cafff;
}
.family-hydra {
  color: #87dca0;
}
.tier {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 5%;
  height: 0.22cqw;
}
.tier-5 {
  background: #f0c35e;
}
.tier-6 {
  background: #ee8866;
}
.tier-7 {
  background: #fa667e;
}
.tier-8 {
  background: #b5f8f1;
}
#board.targeting {
  cursor: crosshair;
}
#screen:fullscreen {
  width: min(100vw, 133.333333dvh);
  height: auto;
  margin: auto;
}
