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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.game-container {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
}

.game-header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  color: #667eea;
  font-size: 2.5em;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-board {
  display: flex;
  justify-content: space-around;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  padding: 15px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
}

.score, .high-score {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.label {
  font-size: 0.9em;
  opacity: 0.9;
  margin-bottom: 5px;
}

#score, #highScore {
  font-size: 1.8em;
}

.difficulty-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
}

.difficulty-selector label {
  font-weight: bold;
  color: #667eea;
  font-size: 1.1em;
}

.difficulty-selector select {
  padding: 10px 20px;
  border: 2px solid #667eea;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  color: #333;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.difficulty-selector select:hover {
  border-color: #764ba2;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.difficulty-selector select:focus {
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.difficulty-selector select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#gameCanvas {
  display: block;
  margin: 20px auto;
  background: #f0f0f0;
  border: 3px solid #667eea;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  height: auto;
}

.game-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover:not(:disabled) {
  background: #d0d0d0;
}

.btn-share {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.instructions {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
}

.instructions h3 {
  color: #667eea;
  margin-bottom: 10px;
}

.instructions p {
  color: #666;
  margin: 8px 0;
  font-size: 0.95em;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  color: #f5576c;
  margin-bottom: 20px;
  font-size: 2em;
}

.modal-content p {
  font-size: 1.3em;
  color: #666;
  margin-bottom: 20px;
}

#finalScore, #finalDifficulty {
  color: #667eea;
  font-weight: bold;
  font-size: 1.5em;
}

@media (max-width: 500px) {
  .game-container {
    padding: 20px;
  }

  h1 {
    font-size: 2em;
  }

  .difficulty-selector {
    flex-direction: column;
    gap: 10px;
  }

  .difficulty-selector select {
    width: 100%;
  }

  .game-controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .modal-buttons {
    flex-direction: column;
    width: 100%;
  }

  .modal-buttons .btn {
    width: 100%;
  }
}
