@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap");
:root {
  font-family: "DM Sans", sans-serif;
  color: #fffce9;
  background: #253d2b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
canvas {
  display: block;
  width: calc(100 * var(--game-vw));
  height: calc(100 * var(--game-vh));
  touch-action: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid #ffffff24;
  background: #243e32e8;
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 3px 0 #14271f;
  transition:
    transform 0.15s,
    background 0.15s;
}
button:hover {
  background: #42624d;
  transform: translateY(-2px);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.active {
  border-color: #f1d082;
  background: #5b6036;
}
header {
  position: fixed;
  top: 26px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
header button {
  pointer-events: auto;
}
.crest {
  font: 800 32px Outfit;
  background: #e6bf69;
  color: #263c30;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
  width: 56px;
  height: 66px;
  text-align: center;
  padding-top: 7px;
}
h1 {
  font: 700 27px Outfit;
  margin: 1px 0;
}
h1 span {
  font-size: 12px;
  background: #ffffff20;
  border-radius: 5px;
  padding: 3px 6px;
}
small {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #cad5b4;
}
header p {
  margin: 0;
  font-size: 12px;
  color: #d6dfc9;
}
.resources {
  margin-left: auto;
  display: flex;
  gap: 9px;
  align-items: center;
}
.resources > div {
  background: #203c2de8;
  border: 1px solid #ffffff20;
  border-radius: 12px;
  padding: 10px 19px;
  min-width: 130px;
}
.resources b {
  font: 600 20px Outfit;
}
.resources small {
  display: block;
  padding-left: 24px;
  font-size: 8px;
}
.resources button {
  font-size: 11px;
}
aside {
  position: fixed;
  left: 30px;
  top: 145px;
  display: grid;
  gap: 12px;
}
.round {
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: 22px;
}
.status {
  position: fixed;
  top: 112px;
  left: 50%;
  transform: translateX(-50%);
  background: #20372bd9;
  border: 1px solid #ffffff20;
  border-radius: 30px;
  padding: 10px 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7df87;
}
footer {
  position: fixed;
  bottom: 26px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: end;
  gap: 20px;
  pointer-events: none;
}
footer > * {
  pointer-events: auto;
}
.actions {
  display: grid;
  gap: 9px;
}
.primary {
  background: #e8be68;
  color: #27372b;
  border-color: #ffe3a4;
  font-size: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 23px;
}
.primary:hover {
  background: #f3cf87;
}
.primary span {
  font: 700 18px Outfit;
  text-align: left;
}
.primary small {
  display: block;
  color: #586040;
  letter-spacing: 0;
  font: 11px "DM Sans";
  margin-top: 3px;
}
#tray {
  display: flex;
  gap: 7px;
  flex: 1;
  justify-content: center;
}
#tray button {
  padding: 9px 12px;
  min-width: 76px;
  font-size: 12px;
  background: #203b2fee;
}
#tray em {
  display: block;
  font-style: normal;
  font-size: 27px;
  margin-bottom: 4px;
}
#tray small {
  display: block;
  letter-spacing: 0;
  font-size: 10px;
  margin-top: 3px;
}
.tools {
  display: grid;
  gap: 8px;
}
.tools > button:first-child {
  background: #e9e6ca;
  color: #2b4435;
  font-weight: 700;
}
.tools > button:nth-child(2) {
  font-size: 10px;
  padding: 7px;
}
.tools small {
  font-size: 8px;
  letter-spacing: 1px;
}
.toast {
  position: fixed;
  bottom: 144px;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 20px;
  background: #1c3028e8;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  transition: opacity 0.4s;
}
#inspector {
  position: fixed;
  right: 30px;
  top: 145px;
  width: 230px;
  background: #213d30f5;
  border: 1px solid #ffffff26;
  border-radius: 16px;
  padding: 18px;
}
#inspector h2 {
  font: 600 21px Outfit;
  margin: 0 0 8px;
}
#inspector p {
  font-size: 12px;
  color: #d3ddc4;
}
#inspector button {
  margin: 4px 0;
  width: 100%;
  font-size: 12px;
}
dialog {
  background: #203b2f;
  color: #faf6df;
  border: 1px solid #9caf87;
  border-radius: 20px;
  padding: 30px;
  max-width: 480px;
}
dialog p {
  font-size: 14px;
  line-height: 1.7;
  color: #d4dfc7;
}
dialog::backdrop {
  background: #10231bcc;
  backdrop-filter: blur(7px);
}
@media (max-width: 800px) {
  header {
    left: 12px;
    right: 12px;
    top: 12px;
  }
  .resources {
    gap: 3px;
  }
  .resources > div {
    min-width: 75px;
    padding: 7px;
  }
  .resources b {
    font-size: 14px;
  }
  .resources button,
  header p {
    display: none;
  }
  h1 {
    font-size: 21px;
  }
  footer {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 7px;
    flex-wrap: wrap;
  }
  #tray {
    order: -1;
    width: 100%;
    flex-basis: 100%;
  }
  #tray button {
    min-width: 55px;
    padding: 5px;
    font-size: 10px;
  }
  .actions {
    display: flex;
  }
  .tools {
    margin-left: auto;
  }
  .tools small,
  #reset {
    display: none;
  }
  .primary {
    padding: 9px;
    font-size: 18px;
  }
  .primary span {
    font-size: 14px;
  }
  aside {
    left: 12px;
  }
  .status {
    top: 95px;
  }
  #inspector {
    right: 12px;
    top: 140px;
  }
  .toast {
    bottom: 180px;
    font-size: 10px;
    max-width: calc(80 * var(--game-vw));
  }
}
