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

body {
  font-family: "Roboto", sans-serif;
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  color: #fff;
  overflow-x: hidden;
}

/* Landing Page Styles */
.landing-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.landing-page.hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

/* Animated Background */
.bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.bg-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
}

/* Header */
.game-title {
  font-family: "Cinzel", serif;
  font-size: 4.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(
    45deg,
    #ff6b6b,
    #ffd93d,
    #6bcf7f,
    #4ecdc4,
    #45b7d1
  );
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.game-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0.9;
  color: #b8b8b8;
}

/* Features Section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin-bottom: 3rem;
  padding: 0 2rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-title {
  font-family: "Cinzel", serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffd93d;
}

.feature-description {
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.8;
}

/* Start Button */
.start-button {
  background: linear-gradient(45deg, #ff6b6b, #ff8e53);
  border: none;
  border-radius: 50px;
  padding: 1.2rem 3rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
  font-family: "Cinzel", serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.start-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.6);
}

.start-button:active {
  transform: translateY(-1px);
}

.start-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.start-button:hover::before {
  left: 100%;
}

/* Tutorial Button */
.tutorial-button {
  background: linear-gradient(45deg, #4ecdc4, #45b7d1);
  border: none;
  border-radius: 50px;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(78, 205, 196, 0.3);
  font-family: "Cinzel", serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
}

.tutorial-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(78, 205, 196, 0.5);
}

.tutorial-button:active {
  transform: translateY(-1px);
}

/* Tutorial Page */
.tutorial-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1001;
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  display: none;
  overflow-y: auto;
  padding: 2rem;
}

.tutorial-page.visible {
  display: block;
}

.tutorial-content {
  max-width: 1200px;
  margin: 0 auto;
  color: #fff;
}

.tutorial-title {
  font-family: "Cinzel", serif;
  font-size: 3.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4ecdc4);
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
}

.tutorial-sections {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.tutorial-section {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  padding: 2rem;
}

.section-title {
  font-family: "Cinzel", serif;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #ffd93d;
  text-align: center;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.key {
  background: #333;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  font-family: monospace;
  min-width: 60px;
  text-align: center;
}

.description {
  flex: 1;
  color: #ddd;
}

.stat-explanation {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 4px solid #4ecdc4;
}

.stat-explanation strong {
  color: #ffd93d;
}

.tips-list {
  display: grid;
  gap: 0.8rem;
}

.tip {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 4px solid #6bcf7f;
}

.tutorial-buttons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.play-button {
  background: linear-gradient(45deg, #ff6b6b, #ff8e53);
  border: none;
  border-radius: 50px;
  padding: 1.2rem 3rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
  font-family: "Cinzel", serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.play-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.6);
}

.back-button {
  background: linear-gradient(45deg, #666, #888);
  border: none;
  border-radius: 50px;
  padding: 1.2rem 3rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(100, 100, 100, 0.4);
  font-family: "Cinzel", serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.back-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(100, 100, 100, 0.6);
}

/* Game Canvas */
#gameContainer {
  background: #000000;
  min-height: 100vh;
  width: 100%;
}

canvas {
  display: block;
  margin: 0 auto;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  background: #000000 !important;
}

canvas.visible {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-title {
    font-size: 3rem;
  }

  .game-subtitle {
    font-size: 1.2rem;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .start-button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }

  .tutorial-button {
    padding: 0.8rem 2rem;
    font-size: 1rem;
  }

  .tutorial-page {
    padding: 1rem;
  }

  .tutorial-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-buttons {
    flex-direction: column;
    align-items: center;
  }

  .play-button,
  .back-button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    max-width: 300px;
  }
}
