:root {
  color-scheme: dark;
  --sky: #77c9ff;
  --deep: #163a78;
  --ink: #fff7d6;
  --line: #1661a8;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 30% 20%, #ffe66d 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #3ac6ff 0%, #3f8cff 45%, #24603d 100%);
  background-size: 18px 18px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

.shell {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  padding: 18px;
}

.game-wrap {
  aspect-ratio: 16 / 9;
  background: #77c9ff;
  border: 2px solid #083b78;
  box-shadow: 0 24px 80px #08214c99, inset 0 0 0 1px #b6edff;
  max-height: calc(100vh - 36px);
  max-width: min(100vw - 36px, 1180px);
  position: relative;
  width: 100%;
}

canvas {
  display: block;
  height: 100%;
  image-rendering: pixelated;
  width: 100%;
}

.hud {
  display: flex;
  gap: 10px;
  left: 16px;
  pointer-events: none;
  position: absolute;
  top: 14px;
}

.hud div {
  align-items: baseline;
  background: #17275dcc;
  border: 1px solid #fff4a3;
  border-radius: 8px;
  display: flex;
  gap: 7px;
  min-width: 84px;
  padding: 7px 10px;
}

.hud span {
  color: #fff4a3;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 850;
  line-height: 1;
  tabular-nums: lining-nums;
}

.hud small {
  color: #c8efff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.toast {
  background: #fff4a3;
  border: 2px solid #17275d;
  border-radius: 8px;
  bottom: 22px;
  box-shadow: 5px 5px 0 #17275d;
  color: #17275d;
  font-size: clamp(14px, 1.7vw, 20px);
  font-weight: 850;
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
}

.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

@media (max-width: 640px) {
  .shell {
    padding: 8px;
  }

  .game-wrap {
    max-width: calc(100vw - 16px);
  }

  .hud {
    gap: 6px;
    left: 8px;
    top: 8px;
  }

  .hud div {
    min-width: 62px;
    padding: 5px 7px;
  }

  .hud small {
    display: none;
  }
}
