* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-image: url(static/images/background.webp);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: 'Poppins', sans-serif;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 140, 0, 0.2) 0%, 
    rgba(255, 69, 0, 0.15) 50%, 
    rgba(138, 43, 226, 0.2) 100%);
  z-index: 1;
}

.game-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 20px;
  width: 100%;
  height: 100vh;
  max-width: 1600px;
  padding: 40px;
}

.header {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  align-self: center;
  text-align: left;
  padding-right: 30px;
}

.game-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 
    0 2px 10px rgba(255, 140, 0, 0.6),
    2px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
  margin-bottom: 5px;
  line-height: 1.2;
  word-wrap: break-word;
  max-width: 300px;
}

.tagline {
  font-size: 1rem;
  font-weight: 600;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.canvas-wrapper {
  position: relative;
  display: inline-block;
  grid-column: 2;
  grid-row: 2;
}

canvas {
  background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 50%, #87CEEB 100%);
  border: none;
  border-radius: 20px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 0 8px rgba(255, 255, 255, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  width: 90vw;
  height: 80vh;
  max-width: 450px;
  max-height: 600px;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.canvas-glow {
  position: absolute;
  top: -10px;
canvas {
  background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 50%, #87CEEB 100%);
  border: none;
  border-radius: 20px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 0 4px rgba(255, 140, 0, 0.3);
  width: 90vw;
  height: 80vh;
  max-width: 450px;
  max-height: 600px;
  position: relative;
  z-index: 2;
}

.canvas-glow {
  display: none;
} max-width: 300px;
}

.control-key {
  background: linear-gradient(135deg, #ff8c00, #ff4500);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(255, 140, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-text {
  font-weight: 600;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

#gameOver {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1000;
}

.game-over-content {
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 40px 50px;
  text-align: center;
  border: 3px solid rgba(255, 140, 0, 0.5);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(255, 140, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.game-over-icon {
  margin-bottom: 20px;
}

.game-over-icon img {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 4px 8px rgba(255, 140, 0, 0.5));
}

.game-over-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ff4500;
  text-shadow: 0 2px 8px rgba(255, 69, 0, 0.6);
  margin-bottom: 25px;
  letter-spacing: 2px;
}

.score-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(138, 43, 226, 0.2));
  border-radius: 15px;
  border: 2px solid rgba(255, 140, 0, 0.3);
}

.score-label {
  font-size: 1rem;
  font-weight: 600;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.score-value {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 
    0 2px 8px rgba(255, 215, 0, 0.8),
    2px 2px 8px rgba(0, 0, 0, 0.7);
}

#restartBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 40px;
  background: linear-gradient(135deg, #ff8c00, #ff4500);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 6px 20px rgba(255, 140, 0, 0.5),
    inset 0 -2px 5px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Poppins', sans-serif;
  margin: 0 auto;
}

#restartBtn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(255, 140, 0, 0.6),
    inset 0 -2px 5px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ff9500, #ff5500);
}

#restartBtn:active {
  transform: translateY(0);
  box-shadow: 
    0 4px 15px rgba(255, 140, 0, 0.5),
    inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-icon {
  font-size: 1.4rem;
}

@media (max-width: 1200px) {
  .game-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
  }

  .header {
    text-align: center;
    padding-right: 0;
  }

  .game-title {
    font-size: 2.5rem;
    max-width: none;
  }

  .controls-hint {
    padding-left: 24px;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .game-title {
    font-size: 2rem;
  }

  .tagline {
    font-size: 0.75rem;
    letter-spacing: 2px;
  }

  canvas {
    width: 95vw;
    height: 75vh;
  }

  .controls-hint {
    font-size: 0.75rem;
    padding: 8px 16px;
    gap: 6px;
  }

  .control-key {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  .game-over-content {
    padding: 30px 35px;
  }

  .game-over-icon img {
    width: 70px;
    height: 70px;
  }

  .game-over-title {
    font-size: 1.8rem;
  }

  .score-label {
    font-size: 0.85rem;
  }

  .score-value {
    font-size: 2.5rem;
  }

  #restartBtn {
    font-size: 1rem;
    padding: 12px 30px;
  }
}
