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

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ff9a9e 100%);
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', 'Nunito', sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

#game-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  padding: 24px 20px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 2rem;
  color: #e74c3c;
  margin-bottom: 8px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);
}

#progress {
  font-size: 1rem;
  color: #7f8c8d;
  margin-bottom: 4px;
  font-weight: 600;
}

#prompt {
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 14px;
  font-weight: 700;
}

#prompt #current-letter {
  color: #e74c3c;
  font-size: 1.8rem;
}

canvas {
  display: block;
  margin: 0 auto 16px;
  background: #fff;
  border: 3px solid #dfe6e9;
  border-radius: 16px;
  cursor: crosshair;
  touch-action: none;
  max-width: 100%;
  width: 400px;
  height: 400px;
}

#buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

button {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 12px 32px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

button:active {
  transform: scale(0.95);
}

#btn-clear {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}

#btn-next {
  background: linear-gradient(135deg, #55efc4, #00b894);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 184, 148, 0.35);
}

#btn-restart {
  background: linear-gradient(135deg, #fd79a8, #e84393);
  color: #fff;
  box-shadow: 0 4px 12px rgba(232, 67, 147, 0.35);
  font-size: 1.3rem;
  padding: 14px 40px;
  margin-top: 16px;
}

#completion {
  padding: 20px;
}

#completion-text {
  font-size: 2.5rem;
  font-weight: 800;
  color: #e74c3c;
  margin-bottom: 8px;
}

#completion p {
  font-size: 1.2rem;
  color: #636e72;
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}

/* celebration burst */
@keyframes celebrate {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.celebrate {
  animation: celebrate 0.5s ease forwards;
}

/* confetti keyframes */
@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  top: -10px;
  z-index: 1000;
  animation: confetti-fall 2.5s ease-in forwards;
  pointer-events: none;
}

@media (max-width: 480px) {
  #game-container {
    padding: 16px 12px 20px;
  }

  h1 {
    font-size: 1.6rem;
  }

  canvas {
    width: 300px;
    height: 300px;
  }

  button {
    padding: 10px 24px;
    font-size: 1rem;
  }
}
