.snake-page {
  min-height: calc(100vh - 70px);
  display: flex;
  justify-content: center;
  padding: 1rem 0.75rem 2rem;
}

.snake-shell {
  width: min(94vw, 520px);
}

.snake-header {
  margin-bottom: 0.5rem;
}

.snake-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.snake-header p {
  margin: 0;
}

.snake-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.snake-meta p {
  margin: 0;
}

.snake-actions {
  display: flex;
  gap: 0.5rem;
}

.snake-actions button,
.touch-controls button {
  border: 1px solid #111;
  background: #fff;
  color: #111;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  touch-action: manipulation;
}

.snake-board {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 1px;
  width: min(94vw, 520px);
  aspect-ratio: 1 / 1;
  border: 1px solid #bbb;
  background: #bbb;
  touch-action: none;
}

.cell {
  background: #fff;
}

.cell.snake {
  background: #111;
}

.cell.food {
  background: #666;
}

.snake-board:focus-visible,
.snake-actions button:focus-visible,
.touch-controls button:focus-visible {
  outline: 3px solid #111;
  outline-offset: 2px;
}

.touch-controls {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
}

.touch-row {
  display: flex;
  gap: 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .snake-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .snake-actions {
    width: 100%;
  }

  .snake-actions button {
    flex: 1;
  }
}
