body {
  font-family: Inter, sans-serif;
}

.tool-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

/* Canvas wrapper */
#canvas-wrap {
  position: relative;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
}
#snake-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Overlay */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.88);
  border-radius: 10px;
  z-index: 10;
  transition: opacity 0.3s;
}
#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Score pills */
.score-pill {
  background: #1f2937;
  border-radius: 8px;
  padding: 6px 14px;
  text-align: center;
  min-width: 64px;
}
.score-pill .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #9ca3af;
  text-transform: uppercase;
}
.score-pill .value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

/* Option toggle */
.opt-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.toggle-track {
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 99px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-track.on {
  background: #059669;
}
.toggle-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-track.on .toggle-thumb {
  transform: translateX(16px);
}

/* D-pad for mobile */
#dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 4px;
  margin: 0 auto;
}
.dpad-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.dpad-btn:active {
  background: #ecfdf5;
}
.dpad-empty {
  background: transparent;
  border: none;
}

@keyframes eatPop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
.eat-pop {
  animation: eatPop 0.15s ease-out;
}
