* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body layout */
body {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e293b, #0f172a);
  color: #f1f5f9;
}

/* Main container */
.container {
  width: 90vw;
  max-width: 400px;
  height: 90vw;
  max-height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Score / instructions */
.score-container {
  height: 10%;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 -1px 4px rgba(0, 0, 0, 0.4);
}

/* Game board */
.game-container {
  width: 100%;
  height: 90%;
  display: grid;
  grid-template: repeat(25, 1fr) / repeat(25, 1fr);
  border-radius: 16px;
  background: linear-gradient(135deg, #111827, #1e293b);
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

/* Food */
.food {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.8);
}

/* Snake body */
.snake {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
  animation: pulse 0.4s infinite alternate;
}

/* Snake head highlight */
.snake:first-child {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(16, 185, 129, 1);
}

/* Snake pulse animation */
@keyframes pulse {
  from { transform: scale(0.95); }
  to { transform: scale(1); }
}

/* Game over overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10;
  border-radius: 16px;
}

.overlay-content {
  background: rgba(255, 255, 255, 0.08);
  padding: 20px 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.overlay h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #f87171;
}

.overlay p {
  font-size: 1rem;
  margin-bottom: 15px;
}

/* Restart button */
#restartBtn {
  background: #22c55e;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  transition: 0.2s;
}
#restartBtn:hover {
  background: #16a34a;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;       /* page scroll disable */
  touch-action: none;     /* browser ke default gestures disable */
}

.game-container {
  touch-action: none;     /* important for swipe controls */
}

