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

body {
  background: #0d0d1a;
  color: #fff;
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

h1 {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 0.6rem;
  color: #5ef0e8;
  text-shadow: 0 0 20px rgba(94, 240, 232, 0.4);
}

.subtitle {
  color: #667788;
  font-size: 0.85rem;
  letter-spacing: 0.05rem;
}

.canvas-wrapper {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(94, 240, 232, 0.2), 0 0 0 2px #1a1a3a;
}

canvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.difficulty-selector {
  display: flex;
  gap: 8px;
}

.diff-btn {
  padding: 7px 20px;
  background: transparent;
  border: 2px solid #222244;
  color: #556677;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05rem;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.diff-btn:hover {
  border-color: #5ef0e8;
  color: #5ef0e8;
}

.diff-btn.active {
  border-color: #5ef0e8;
  color: #0d0d1a;
  background: #5ef0e8;
}

.controls {
  display: flex;
  gap: 12px;
}

.controls button {
  padding: 9px 24px;
  background: transparent;
  border: 2px solid #333355;
  color: #aabbcc;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.controls button:hover {
  border-color: #5ef0e8;
  color: #5ef0e8;
}

.controls button:active {
  background: rgba(94, 240, 232, 0.1);
}

.win-message {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
}

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

.win-box {
  background: #12122a;
  border: 2px solid #5ef0e8;
  border-radius: 20px;
  padding: 48px 64px;
  text-align: center;
  box-shadow: 0 0 60px rgba(94, 240, 232, 0.3);
}

.win-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.win-box h2 {
  font-size: 2.2rem;
  color: #5ef0e8;
  margin-bottom: 8px;
}

.level-label {
  font-size: 0.8rem;
  color: #5ef0e8;
  letter-spacing: 0.1rem;
  opacity: 0.7;
}

.win-box p {
  color: #889900;
  margin-bottom: 28px;
}

.win-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.win-box button {
  padding: 12px 36px;
  background: #5ef0e8;
  border: none;
  color: #0d0d1a;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

.win-box button:hover {
  opacity: 0.85;
}

