:root {
  color-scheme: dark;
  --hud-text: #fff8ef;
  --hud-muted: rgba(255, 248, 239, 0.72);
  --panel: rgba(7, 22, 43, 0.54);
  --panel-border: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #04172c;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  min-width: 320px;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 58% 22%, rgba(67, 194, 211, 0.24), transparent 34rem),
    linear-gradient(180deg, #086277 0%, #07476d 34%, #092b56 66%, #07152e 100%);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

.hud {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  color: var(--hud-text);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--hud-muted);
  font-size: clamp(0.72rem, 1.7vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4.8vw, 4.35rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(46vw, 360px);
}

.stats span,
.pause-button {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--hud-muted);
  font-size: clamp(0.76rem, 1.9vw, 0.92rem);
  font-weight: 700;
  white-space: nowrap;
}

.stats strong {
  color: var(--hud-text);
  font-size: 1.12em;
}

.pause-button {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 3;
  min-width: 76px;
  min-height: 42px;
  padding: 9px 14px;
  color: var(--hud-text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
}

.pause-button:focus-visible {
  outline: 3px solid rgba(255, 189, 97, 0.8);
  outline-offset: 3px;
}

@media (max-width: 620px) {
  .game-shell {
    min-height: 100svh;
  }

  .hud {
    align-items: stretch;
  }

  .stats {
    max-width: 132px;
  }

  .stats span {
    min-height: 34px;
    padding: 7px 9px;
  }

  .pause-button {
    min-width: 68px;
    min-height: 38px;
    padding: 8px 11px;
  }
}
