* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(135deg, #f0e6ff 0%, #ffe6f0 25%, #fff5e6 50%, #e6fff0 75%, #e6f0ff 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

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

#canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: all;
  animation: fadeIn 0.3s ease;
}

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

.modal-box {
  background: linear-gradient(145deg, #fff8ff, #fff0f8);
  border-radius: 28px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(180, 100, 200, 0.3), 0 0 0 3px rgba(255,255,255,0.8);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-box h2 {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 28px;
  color: #8b5cf6;
  margin-bottom: 12px;
}

.modal-box p {
  font-size: 17px;
  color: #6b5b7b;
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal-btn {
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  color: white;
  border: none;
  border-radius: 18px;
  padding: 14px 36px;
  font-family: 'Bubblegum Sans', cursive;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.4);
  pointer-events: all;
}

.modal-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.6);
}

.modal-btn:active {
  transform: scale(0.97);
}

.victory-title {
  font-size: 42px !important;
  animation: victoryBounce 0.6s ease infinite alternate;
}

@keyframes victoryBounce {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.stats-line {
  font-size: 15px;
  color: #7c6b8f;
  margin: 4px 0;
}