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

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  background: #08131b;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #6bd7ff;
}

.hud {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(78px, 1fr));
  gap: 8px;
  width: min(760px, calc(100vw - 32px));
  pointer-events: none;
}

.hud div,
.controls,
.control-action {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 19, 27, 0.62);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.hud div {
  min-width: 0;
  padding: 10px 12px;
}

.hud span,
.hud label,
.hud strong {
  display: block;
  white-space: nowrap;
}

.hud span,
.hud label {
  color: rgba(248, 251, 255, 0.68);
  font-size: 11px;
  line-height: 1.1;
}

.hud strong {
  margin-top: 4px;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 780;
}

.controls {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: min(250px, calc(100vw - 32px));
  padding: 10px 12px;
}

.controls dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.controls div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: baseline;
}

.controls dt,
.controls dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}

.controls dt {
  color: #f8fbff;
  font-weight: 760;
}

.controls dd {
  color: rgba(248, 251, 255, 0.76);
  font-weight: 620;
}

.control-action {
  min-width: 68px;
  min-height: 28px;
  padding: 4px 10px;
  color: #f8fbff;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.control-action:hover,
.control-action:focus-visible {
  background: rgba(248, 251, 255, 0.18);
  outline: none;
}

.restart {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: 132px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #f8fbff;
  color: #12202a;
  font: inherit;
  font-weight: 780;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.restart:hover {
  background: #e5f2ff;
}

@media (max-width: 560px) {
  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100vw - 24px);
    top: 12px;
    left: 12px;
  }

  .hud div {
    padding: 8px 9px;
  }

  .hud strong {
    font-size: 16px;
  }

  .controls {
    left: 12px;
    bottom: 12px;
    width: min(224px, calc(100vw - 24px));
  }
}
