/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(120deg, #0d0d0d, #111111, #0d0d0d);
  color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Animated glowing background */
body::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    #00d9ff,
    #001366,
    #000000,
    #003e79,
    #009471
  );
  animation: spin 60s linear infinite;
  filter: blur(300px);
  z-index: -1;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.game-container {
  text-align: center;
  max-width: 600px;
  width: 150%;
  padding: 2rem;
  border-radius: 20px;
  background: rgba(25, 25, 25, 0.7);
  backdrop-filter: blur(15px) saturate(150%);
  box-shadow: 0 0 40px rgba(0,255,200,0.3), inset 0 0 20px rgba(255,255,255,0.05);
  animation: fadeIn 1.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

h1 {
  font-size: 2.5rem;
  color: #00ffc3;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(0, 255, 195, 0.8);
}

.subtitle {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 2rem;
}

#cropCanvas {
  border: 3px solid #00ffc3;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 25px rgba(0, 255, 195, 0.5);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

input, button {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

/* Input styling (glassy) */
input {
  width: 250px;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}

input:focus {
  border-color: #00ffc3;
  box-shadow: 0 0 15px rgba(0, 255, 195, 0.5);
}

/* Button styling (neon) */
button {
  background: linear-gradient(135deg, #00ffc3, #00bfa5);
  color: #0d0d0d;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 0.5px;
  box-shadow: 0 0 15px rgba(0, 255, 195, 0.6);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 255, 195, 0.9);
}

/* Hint text */
#hintArea {
  color: #ff4081;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 64, 129, 0.7);
}

/* Feedback messages */
#feedback {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Final screen */
#final-screen.hidden {
  display: none;
}

#final-screen h2 {
  font-size: 2rem;
  color: #00ffc3;
  text-shadow: 0 0 20px rgba(0,255,195,0.8);
}

/* Mobile responsive */
@media (max-width: 600px) {
  h1 {
    font-size: 1.8rem;
  }

  input {
    width: 100%;
  }

  .controls {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
