* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #2a2a72 0%, #1e1b4b 100%);
  font-family: "Segoe UI", sans-serif;
  overflow: hidden;
}

.game-container {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  width: 95vw;
  max-width: 900px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.watermark {
  position: absolute;
  bottom: 40px;
  right: 15px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  animation: flicker 3s infinite ease-in-out;
  z-index: 10;
}

.watermark-done {
  position: absolute;
  bottom: 15px;
  right: 15px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  animation: flicker 3s infinite ease-in-out reverse;
  z-index: 10;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  color: #e0e7ff;
  flex-wrap: wrap;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, #a5b4fc, #818cf8);
  -webkit-background-clip: text;
  color: transparent;
}

.moves,
.level {
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.maze-container {
  display: grid;
  grid-gap: 3px;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 1rem;
}

.maze-cell {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  transition: transform 0.2s ease, background 0.3s ease;
}

.wall {
  background: linear-gradient(45deg, #1e293b, #334155);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
  animation: wallShift 3s infinite ease-in-out;
}

.path {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1);
}

.exit {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  animation: exitPulse 1.5s infinite ease-in-out;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
}

.player {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.9);
  animation: playerBounce 0.8s infinite ease-in-out;
  border-radius: 50%;
}

/* Victory Screen */
.victory-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 1.5rem;
  color: #e0e7ff;
  text-align: center;
  animation: fadeIn 0.5s ease-in;
}

.victory-overlay.hidden {
  display: none;
}

.trophy {
  font-size: 4rem;
  animation: trophySpin 2s infinite linear;
}

.play-again {
  margin-top: 1.5rem;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  color: white;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.play-again:hover {
  transform: scale(1.05);
  background: linear-gradient(90deg, #4338ca, #6d28d9);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

.reset-btn {
  padding: 0.5rem 1rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.reset-btn:hover {
  background: #dc2626;
}

.instructions {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
}

/* Animations */
@keyframes wallShift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
}

@keyframes exitPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes playerBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes trophySpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
