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

body {
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  cursor: none;
  /* Prevent pull-to-refresh and unwanted scrolling on mobile */
  overscroll-behavior: none;
  touch-action: none;
}

/* Canvas elements should prevent touch default behavior */
canvas {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Interactive elements on mobile should allow proper touch handling */
button, a, .color-toggle, .color-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-gif {
  max-width: 120px;
  max-height: 120px;
  animation: cuteHop 17.5s linear forwards;
}

@keyframes cuteHop {
 0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  10%  { transform: translate(0, 0) rotate(0deg) scale(1); }

  /* Jump impulse */
  14%  { transform: translate(0, -90px) rotate(-4deg) scale(1.03); }
  18%  { transform: translate(0, -150px) rotate(-7deg) scale(1.04); }

  /* Hang */
  22%  { transform: translate(-6px, -160px) rotate(-3deg) scale(1.03); }
  26%  { transform: translate(-10px, -155px) rotate(2deg) scale(1.02); }
  30%  { transform: translate(-4px, -145px) rotate(5deg) scale(1.02); }

  /* Drift down */
  34%  { transform: translate(8px, -110px) rotate(2deg) scale(1.01); }
  38%  { transform: translate(16px, -60px) rotate(-3deg) scale(1); }

  /* Float */
  42%  { transform: translate(24px, 20px) rotate(-6deg) scale(1); }
  46%  { transform: translate(18px, 90px) rotate(-2deg) scale(1); }
  50%  { transform: translate(8px, 170px) rotate(3deg) scale(1); }
  54%  { transform: translate(-4px, 270px) rotate(6deg) scale(0.995); }
  58%  { transform: translate(-18px, 390px) rotate(3deg) scale(0.995); }

  /* Long airy fall */
  62%  { transform: translate(-30px, 540px) rotate(-2deg) scale(0.99); }
  66%  { transform: translate(-24px, 720px) rotate(-6deg) scale(0.99); }
  70%  { transform: translate(-10px, 920px) rotate(-10deg) scale(0.985); }
  74%  { transform: translate(10px, 1140px) rotate(-6deg) scale(0.985); }
  78%  { transform: translate(26px, 1380px) rotate(-2deg) scale(0.98); }

  /* Fully offscreen, STILL VISIBLE */
  82%  { transform: translate(34px, 160vh) rotate(2deg) scale(0.98); }
  90%  { transform: translate(40px, 190vh) rotate(6deg) scale(0.97); }

  /* Only fade once it’s gone */
  98%  { opacity: 1; }
  100% {
    transform: translate(40px, 220vh) rotate(8deg) scale(0.97);
    opacity: 0;
  }
}

#zen-garden {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block !important;
  visibility: visible !important;
  background: #1a1a2e !important;
}

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

header {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: transparent;
  text-shadow: none;
  transition: all 0.3s ease;
}

header h1.lit {
  background: linear-gradient(90deg, 
    #00ff00 0%,   /* Green */
    #ff0000 25%,  /* Red */
    #ffff00 50%,  /* Yellow */
    #0000ff 75%,  /* Blue */
    #00ff00 100%  /* Green */
  );
  background-size: 400% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: flameText 3s ease infinite;
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 1),
    0 0 20px rgba(0, 255, 0, 0.8),
    0 0 30px rgba(255, 0, 0, 0.6),
    0 0 40px rgba(255, 255, 0, 0.5),
    0 0 50px rgba(0, 0, 255, 0.4);
}

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

.color-picker-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 99;
  pointer-events: none;
}

.color-picker-container:hover .color-picker,
.color-picker.visible {
  opacity: 1;
  visibility: visible;
}

.color-picker {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.6);
  padding: 12px 20px;
  border-radius: 30px;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.color-toggle-area {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100px;
  height: 100px;
  z-index: 99;
  pointer-events: auto;
}

.color-toggle-area:hover .color-toggle,
.color-toggle-area:hover ~ .color-picker-container .color-picker,
.color-toggle:hover,
.color-toggle:focus {
  opacity: 1;
  visibility: visible;
}

.color-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #222222, #111111);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  z-index: 100;
  pointer-events: auto;
  transition: all 0.3s ease;
  opacity: 0;
}

.color-toggle:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.picker-label {
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-right: 5px;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-btn:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.color-btn.active {
  border-color: #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.loader {
  width: 60px;
  height: 60px;
  border: 3px solid #333;
  border-top-color: #3399ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading p {
  margin-top: 20px;
  color: #888;
  font-size: 14px;
  letter-spacing: 2px;
}

.flame-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 40px;
  height: 60px;
  transform: translate(-50%, -80%);
}

.flame-cursor .flame {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 40px;
  background: radial-gradient(ellipse at bottom, #aaffff 0%, #33ccff 30%, #0066ff 60%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.15s infinite alternate;
  filter: blur(1px);
}

.flame-cursor .flame::before {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 25px;
  background: radial-gradient(ellipse at bottom, #aaffff 0%, #33ccff 50%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.1s infinite alternate-reverse;
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-2deg); }
  100% { transform: translateX(-50%) scale(1.05) rotate(2deg); }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 22px;
  }
  
  .color-picker {
    bottom: 20px;
    padding: 10px 15px;
    gap: 8px;
  }
  
  .color-btn {
    width: 24px;
    height: 24px;
  }
  
  .picker-label {
    font-size: 10px;
  }
}

