:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #06080d;
  color: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 15%, #122033 0, transparent 32%),
    #06080d;
}

.stage {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16));
  max-height: 100dvh;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #070a10;
  box-shadow: 0 0 80px #0009;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #070a10;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.topline {
  position: absolute;
  top: 3%;
  right: 5%;
  left: 5%;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.stats,
.hint {
  position: absolute;
  left: 50%;
  width: 88%;
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
}

.stats {
  top: 6.7%;
  font-size: 0.75rem;
  opacity: 0.75;
}

.hint {
  top: 9.4%;
  font-size: 0.68rem;
  line-height: 1.4;
  opacity: 0.5;
}

.status {
  position: absolute;
  right: 6%;
  bottom: calc(8.4% + 11rem);
  left: 6%;
  display: grid;
  gap: 0.4rem;
  font-size: 0.72rem;
}

.progress {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: #ffffff14;
}

.progress__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #61b3ff, #d6ffff);
  box-shadow: 0 0 16px #61b3ff99;
  transition: width 100ms linear;
}

.settings {
  position: absolute;
  right: 5%;
  bottom: 8.4%;
  left: 5%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  pointer-events: auto;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ffffff18;
  border-radius: 0.75rem;
  background: #0d1320dc;
  backdrop-filter: blur(10px);
  font-size: 0.7rem;
}

.setting--scenario {
  grid-column: 1 / -1;
}

.setting:not(.setting--scenario) {
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0.25rem 0.4rem;
}

.setting input,
.setting select {
  min-width: 0;
  border: 1px solid #ffffff20;
  border-radius: 0.5rem;
  outline: none;
  background: #080d15;
  color: #fff;
  font: inherit;
}

.setting input {
  width: 100%;
  padding: 0.2rem 0.35rem;
  text-align: center;
}

.setting select {
  flex: 1;
  padding: 0.32rem 1.8rem 0.32rem 0.5rem;
}

.setting input:focus,
.setting select:focus {
  border-color: #61b3ffaa;
}

.controls {
  position: absolute;
  right: 5%;
  bottom: 2.2%;
  left: 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  pointer-events: auto;
}

button {
  padding: 0.65rem;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  background: #0d1320dc;
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

button:hover:not(:disabled) {
  border-color: #61b3ff77;
  background: #15233aee;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: wait;
  opacity: 0.5;
}

@media (max-height: 640px) {
  .hint {
    display: none;
  }

  .status {
    bottom: calc(10.5% + 11rem);
  }

  .settings {
    bottom: 10.5%;
  }

  .controls {
    bottom: 1%;
  }

  button {
    padding: 0.5rem;
  }
}
