body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: white;
  user-select: none;
}

h1 {
  margin-bottom: 10px;
  text-shadow: 0 0 5px #1aff1a;
}

#game-container {
  position: relative;
  width: 400px;
  height: 400px;
}

canvas {
  background: #0a1a2f;
  border-radius: 20px;
  box-shadow: 0 0 15px #1aff1a;
  display: block;
}

/* أزرار تحكم داخل اللعبة فوق الكanvas */
#touch-controls {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 15px;
  padding: 10px;
  display: grid;
  grid-template-columns: 50px 50px 50px;
  grid-template-rows: 50px 50px;
  gap: 10px;
  user-select: none;
}

/* ترتيب الأزرار في شبكة بحيث السهم الأعلى يكون في الصف الأول الأوسط */
#btnUp {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

#btnLeft {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
}

#btnDown {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

#btnRight {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
}

.control-btn {
  font-size: 24px;
  border: none;
  border-radius: 50%;
  background: #1aff1a;
  color: #002200;
  cursor: pointer;
  box-shadow: 0 0 8px #00ff00;
  transition: background-color 0.3s;
}

.control-btn:active {
  background-color: #00cc00;
  box-shadow: 0 0 12px #00ff00;
}

p {
  margin-top: 15px;
  font-weight: 600;
  text-shadow: 0 0 3px #0f9d58;
  user-select: none;
}

#notification {
  margin-top: 20px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #1aff1a;
  border-radius: 8px;
  font-size: 18px;
  min-height: 24px;
  color: white;
  opacity: 0;
  transition: opacity 0.5s;
  text-align: center;
  max-width: 400px;
}

#restartBtn {
  margin-top: 15px;
  padding: 10px 25px;
  font-size: 18px;
  background-color: #1aff1a;
  color: #002200;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 0 10px #00ff00;
  transition: background-color 0.3s;
}

#restartBtn:hover {
  background-color: #00cc00;
}


.link-button {
  display: inline-block;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 75, 43, 0.4);
  transition: background 0.3s ease, transform 0.2s ease;
  text-align: center;
  margin-top: 20px;
}

.link-button:hover {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  transform: scale(1.05);
}


.link-button {
  display: inline-block;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 75, 43, 0.4);
  transition: background 0.3s ease, transform 0.2s ease;
  text-align: center;
  margin-top: 20px;
}

.link-button:hover {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  transform: scale(1.05);
}