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

html,
body {
  margin: 0;
  min-height: 100%;
  background: #10141a;
  color: #e8eef5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.05em;
}

.hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

/* Swipes steer the snake here, so a gesture must never become a scroll: the
   board turns the browser's touch handling off with touch-action none (the
   swipe module's preventDefault on touchmove makes the same promise in code). */
.board {
  display: block;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  height: auto;
  background: #1a2029;
  border: 2px solid #2e3a48;
  border-radius: 6px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.start {
  font: inherit;
  font-size: 1.125rem;
  padding: 10px 28px;
  border: 0;
  border-radius: 6px;
  background: #3ddc84;
  color: #10141a;
  cursor: pointer;
}

.start:focus-visible {
  outline: 3px solid #e8eef5;
  outline-offset: 2px;
}

/* Phone play: on a narrow screen the whole game — heading, readouts, board,
   control — fits one view with room for a thumb to swipe, so nothing has to
   scroll and the Start/Play again control stays an easy tap. */
@media (max-width: 480px) {
  .game {
    padding: 12px;
    gap: 10px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .hud {
    font-size: 1rem;
  }

  .start {
    padding: 12px 32px;
    font-size: 1.25rem;
  }
}
