@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

:root {
  --ghibli-sky-start: #d3f3f1;
  --ghibli-sky-end: #a1d6e2;
  --ghibli-grass: #72b185;
  --ghibli-wood: #8d6e63;
  --crayon-blend: multiply;
}

body {
  font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #e3f2fd 0%, #fff9c4 50%, #e8f5e9 100%);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Wobbly Hand-Drawn Borders for a sketchy Ghibli aesthetic */
.sketchy-border {
  border: 4px solid #4a3b32;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

.sketchy-btn {
  border: 3px solid #4a3b32;
  border-radius: 12px 4px 12px 4px / 4px 12px 4px 12px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sketchy-btn:hover {
  transform: scale(1.08) rotate(-1deg);
}

.sketchy-btn:active {
  transform: scale(0.95);
}

/* Coloring paper with soft watercolor shadow */
.paper-canvas {
  background-color: #ffffff;
  background-image: 
    radial-gradient(#f4f0ea 10%, transparent 11%),
    radial-gradient(#f4f0ea 10%, transparent 11%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  box-shadow: 
    0 15px 35px rgba(74, 59, 50, 0.15),
    0 5px 15px rgba(0, 0, 0, 0.08),
    inset 0 0 40px rgba(0, 0, 0, 0.02);
}

/* Interactive Sticker Controls */
.sticker-container {
  position: absolute;
  cursor: move;
  touch-action: none;
}

.sticker-container.selected {
  outline: 3px dashed #ff6b6b;
  outline-offset: 4px;
}

.sticker-control {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #4a3b32;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s ease;
}

.sticker-control:hover {
  transform: scale(1.2);
}

.sticker-delete {
  top: -16px;
  left: -16px;
  background: #ff5252;
  color: white;
}

.sticker-rotate {
  bottom: -16px;
  right: -16px;
  background: #4caf50;
  color: white;
}

/* Slider and Palette Styles */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: #ecdcc9;
  height: 12px;
  border-radius: 6px;
  border: 2px solid #4a3b32;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff7675;
  border: 2px solid #4a3b32;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Glitter & Gradient shifting backgrounds */
.metallic-gold {
  background: linear-gradient(135deg, #ffe259 0%, #ffa751 100%);
  animation: shine 3s infinite linear;
}

.rainbow-gradient {
  background: linear-gradient(90deg, #ff7675, #ffe259, #55efc4, #74b9ff, #a29bfe, #ff7675);
  background-size: 400% 400%;
  animation: rainbow-shift 8s ease infinite;
}

.unicorn-gradient {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
}

.starry-glitter {
  background: #2d3436;
  position: relative;
  overflow: hidden;
}

.starry-glitter::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle, #fff 10%, transparent 11%),
    radial-gradient(circle, #fff 5%, transparent 6%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.3;
  animation: twinkle 1.5s infinite alternate;
}

/* Custom Cursors */
.cursor-paint {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="%234A3B32"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 14H11v-4H7V9h4V5h2v4h4v3h-4v4z"/></svg>'), auto;
}

/* Animations */
@keyframes twinkle {
  0% { opacity: 0.1; }
  100% { opacity: 0.6; }
}

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

@keyframes shine {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
  100% { filter: brightness(1); }
}

/* Custom Scrollbars */
.custom-scroll::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: #f1f8e9;
  border-radius: 10px;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: #81c784;
  border-radius: 10px;
  border: 2px solid #f1f8e9;
}

/* Soft Ghibli Cloud background decoration */
.ghibli-cloud {
  position: absolute;
  background: white;
  border-radius: 100px;
  filter: blur(8px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: float-cloud 40s linear infinite;
}

@keyframes float-cloud {
  0% { transform: translateX(-200px); }
  100% { transform: translateX(110vw); }
}

/* Bounce and Pop animations */
.bounce-in {
  animation: bounce-anim 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bounce-anim {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.pulse-slow {
  animation: pulse-slow-anim 2s infinite ease-in-out;
}

@keyframes pulse-slow-anim {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
