/* General reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
}

body {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
}

/* Header */
header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 1rem 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.heading {
  font-size: 1.8rem;
  font-weight: bold;
  color: #fdfdfd;
  letter-spacing: 1px;
}

#themeToggle {
  font-size: 1.5rem;
  border: none;
  background: transparent;
  color: #fdfdfd;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#themeToggle:hover {
  transform: rotate(20deg) scale(1.2);
}

/* Game container */
.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  width: 90%;
  max-width: 800px;
}

/* Game info */
.game-info {
  text-align: center;
  margin-bottom: 1rem;
}

.game-info h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: #ffe082;
}

.game-info p {
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.5;
}

/* Canvas styling */
#myCanvas {
  background: radial-gradient(circle, #0d47a1, #000);
  border-radius: 12px;
  border: 2px solid #64b5f6;
  margin: 1.5rem 0;
  box-shadow: 0 0 30px rgba(0, 140, 255, 0.3);
}

/* Game options */
.game-option {
  text-align: center;
  width: 100%;
  margin-top: 1.5rem;
}

.game-option h3 {
  color: #ffcc80;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.speed-container,
#size-container {
  margin: 0.5rem 0;
}

label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

input[type="range"] {
  width: 60%;
  cursor: pointer;
  accent-color: #64b5f6;
}

/* Buttons */
button {
  padding: 0.7rem 1.5rem;
  border: none;
  background: linear-gradient(90deg, #42a5f5, #1e88e5);
  color: white;
  border-radius: 25px;
  font-size: 1rem;
  margin-top: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  background: linear-gradient(90deg, #64b5f6, #2196f3);
  transform: translateY(-3px);
}

/* Alerts */
.alert {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.6s ease forwards;
}

.alert strong {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.success {
  border: 2px solid #81c784;
}

.failure {
  border: 2px solid #e57373;
}

.close {
  background: linear-gradient(90deg, #66bb6a, #43a047);
}

.close:hover {
  background: linear-gradient(90deg, #81c784, #388e3c);
}

/* Footer */
footer {
  width: 100%;
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  color: #bdbdbd;
}

footer span {
  display: inline-block;
  opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  #myCanvas {
    width: 90%;
    height: auto;
  }

  .heading {
    font-size: 1.4rem;
  }
}
