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

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 15%, rgba(54, 112, 160, 0.42), transparent 31rem),
    linear-gradient(135deg, #191b1e 0%, #21282d 42%, #181313 100%);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 0.8rem 1.05rem;
  background: #f2b84b;
  color: #1b1510;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.game-shell {
  width: min(430px, calc(100vw - 16px));
  height: min(100dvh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.hud,
.command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 17, 20, 0.72);
  backdrop-filter: blur(14px);
}

.hud {
  border-radius: 8px 8px 0 0;
}

.label {
  margin: 0 0 2px;
  color: #f2b84b;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.05;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.stats span,
.command-bar span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.stage-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d1117;
  min-height: 0;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  background: rgba(8, 10, 13, 0.52);
}

.overlay.hidden {
  display: none;
}

.overlay p {
  margin: 0;
  color: #e6dcc8;
}

.command-bar {
  justify-content: flex-start;
  flex-wrap: wrap;
  border-radius: 0 0 8px 8px;
}

@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
  }

  body {
    place-items: stretch;
    padding: 0;
  }

  .game-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    gap: 0;
  }

  .hud {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 8px;
  }

  .label {
    display: none;
  }

  h1 {
    font-size: 0.98rem;
  }

  .stats span,
  .command-bar span {
    min-height: 28px;
    font-size: 0.78rem;
    padding: 0 7px;
  }

  .stage-wrap {
    border-left: 0;
    border-right: 0;
  }

  .command-bar {
    max-height: 68px;
    overflow: auto;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 6px;
    gap: 6px;
  }

  .stats {
    justify-content: flex-start;
  }
}
