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

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 18% 20%, rgba(38, 201, 190, 0.32), transparent 28%),
    radial-gradient(circle at 72% 18%, rgba(255, 213, 86, 0.24), transparent 24%),
    linear-gradient(150deg, #070915 0%, #13172f 50%, #15100d 100%);
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hud {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr)) auto;
  gap: 8px;
  align-items: stretch;
  pointer-events: none;
}

.hud > div,
.hud button,
.overlay {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 9, 21, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.hud > div {
  min-height: 54px;
  border-radius: 8px;
  padding: 8px 10px;
}

.label {
  display: block;
  color: #9dd9ef;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  line-height: 1;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #071019;
  background: #ffe05f;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.hud button {
  min-width: 84px;
  padding: 0 14px;
  color: #f8fbff;
  pointer-events: auto;
}

.overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(430px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.overlay.hidden {
  display: none;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 7vw, 56px);
  line-height: 0.95;
}

p {
  margin: 0 0 20px;
  color: #d4ebff;
  font-size: 16px;
  line-height: 1.5;
}

.overlay button {
  width: 100%;
  color: #10131f;
}

@media (pointer: coarse), (max-width: 760px) {
  .hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .hud button {
    grid-column: 1 / -1;
    min-height: 40px;
  }
}
