:root {
  --bg: #05060f;
  --text: #f5f5ff;
  --muted: #8c93c7;
  --accent: #ffd60a;
  --btn: #1b2050;
  --btn-hover: #2a3278;
  --btn-border: #3a4aa8;
}

:root:not([data-theme="light"]) {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.6;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 4vw, 36px);
  width: 100%;
  max-width: 640px;
  font-size: 12px;
  text-align: center;
}

.hud .label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
}

.board {
  position: relative;
  width: 100%;
  max-width: 620px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  touch-action: none;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 0 0 1px #14204a, 0 0 40px #1b2fff33;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  text-align: center;
}

.overlay h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(18px, 5vw, 28px);
  font-weight: normal;
  text-shadow: 0 0 12px #ffd60a88;
}

.overlay p {
  margin: 0;
  line-height: 1.9;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.controls p {
  margin: 0;
}

button {
  padding: 10px 14px;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  background: var(--btn);
  color: var(--text);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

button:hover {
  background: var(--btn-hover);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .hud {
    font-size: 10px;
  }

  .overlay p {
    font-size: 9px;
  }
}
