* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
}

:root {
  /* Background Colors */
  --bg-primary-color: #0c0c0c;
  --bg-fill-color: #fdfdfc;
  --bg-food-color: #ff3b3b;

  /* Text Colors */
  --text-primary-color: #f0f0f0;
  --text-fill-color: #0c0c0c;

  /* Spacing Variables */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 40px;
  --spacing-3xl: 48px;

  /* Border Colors */
  --border-primary-color: #333333;

  /* Border Radius */
  --border-radius-xs: 4px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  --border-radius-2xl: 24px;
  --border-radius-3xl: 28px;
}

html {
  background-color: var(--bg-primary-color);
  color: var(--text-primary-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

main,
section {
  width: 100%;
  height: 100%;
}

.btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-fill-color);
  color: var(--text-fill-color);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: scale(1.1);
}

.btn-pause {
  font-size: 0.9rem;
  padding: var(--spacing-xs) var(--spacing-sm);
}

section {
  padding: var(--spacing-2xl);
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: var(--spacing-lg);
}

section .infos {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-primary-color);
  border-radius: var(--border-radius-sm);
}

.pause-btn-container {
  border: none;
  padding: 0;
}

.board {
  border: 1px solid var(--border-primary-color);
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
  grid-template-rows: repeat(auto-fill, minmax(20px, 1fr));
}

.block {
  border: 0px solid var(--border-primary-color);
  border-radius: 50%;
}

.fill {
  background-color: var(--bg-fill-color);
  border-radius: var(--border-radius-sm);
}

.head {
  position: relative;
  border-radius: 10px;
}

.head::before,
.head::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: var(--text-fill-color);
  border-radius: 50%;
}

/* Eyes position based on direction */
.head[data-direction="right"]::before {
  top: 4px;
  right: 4px;
}

.head[data-direction="right"]::after {
  bottom: 4px;
  right: 4px;
}

.head[data-direction="left"]::before {
  top: 4px;
  left: 4px;
}

.head[data-direction="left"]::after {
  bottom: 4px;
  left: 4px;
}

.head[data-direction="up"]::before {
  top: 4px;
  left: 4px;
}

.head[data-direction="up"]::after {
  top: 4px;
  right: 4px;
}

.head[data-direction="down"]::before {
  bottom: 4px;
  left: 4px;
}

.head[data-direction="down"]::after {
  bottom: 4px;
  right: 4px;
}

.food {
  background-color: var(--bg-food-color);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.modal {
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  background-color: #35353587;
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal .start-game,
.modal .game-over,
.modal .game-paused {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

.modal .game-over,
.modal .game-paused {
  display: none;
}
