:root {
  --bg: linear-gradient(180deg, #f6f1e8 0%, #f1ebe1 100%);
  --panel: #fffaf0;
  --line: #d7d0c4;
  --text: #201d18;
  --snake: #376f49;
  --snake-head: #274d33;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

.meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.meta p {
  margin: 0;
}

.actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.board-wrap {
  width: min(94vw, 560px);
}

.board {
  display: grid;
  grid-template-columns: repeat(var(--grid-width), 1fr);
  grid-template-rows: repeat(var(--grid-height), 1fr);
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: visible;
  position: relative;
}

.cell {
  border: 1px solid #f0f0f0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.cell.snake {
  background: var(--snake);
}

.cell.snake-head {
  background: var(--snake-head);
}

.cell.food {
  background-color: transparent;
  background-image: url("./assets/figma-logo.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 64%;
}

.snake-face-overlay {
  position: absolute;
  z-index: 3;
  display: block;
  pointer-events: none;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.snake-bite-mark {
  position: absolute;
  z-index: 4;
  border-radius: 999px;
  background: #111111;
  border: 0;
  pointer-events: none;
}

.controls {
  margin-top: 12px;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
}

.controls-row {
  display: flex;
  gap: 8px;
}

.help {
  margin-top: 12px;
  color: #555;
}
