/* ==========================================================================
   iPadOS Grade Preschool Theme: Reset & Baby-Proofing Layout
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Comic Neue", "Bubblegum Sans", sans-serif;
  --bg-gradient: linear-gradient(135deg, #FFF1EB 0%, #ACE0F9 100%);
  --dock-bg: rgba(255, 255, 255, 0.92);
  --shadow-tactile: 0 14px 30px rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

html, body {
  width: 100vw;
  height: 100vh;
  height: -webkit-fill-available;
  overflow: hidden !important;
  position: fixed;
  background: #FFFFFF;
  font-family: var(--font-family);
  touch-action: none !important;
  overscroll-behavior: none !important;
}

/* App Fullscreen Container */
#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Fullscreen Canvas Playground (Occupies entire viewport behind floating UI) */
.canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  background: #FFFFFF;
}

/* Top Action Bar (Floating Over Fullscreen Canvas) */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  z-index: 50;
  pointer-events: none;
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  pointer-events: auto;
}

/* Giant Toddler Touch Buttons */
.toddler-btn {
  height: 78px;
  min-width: 78px;
  padding: 0 28px;
  border-radius: 40px;
  background: #FFFFFF;
  border: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.16), 0 4px 0 #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 30px;
  font-weight: 900;
  color: #334155;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s;
}

.toddler-btn:active {
  transform: scale(0.92) translateY(4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12), 0 1px 0 #CBD5E1;
}

.toddler-btn.btn-home {
  background: #FFDD00;
  color: #78350F;
  box-shadow: 0 12px 26px rgba(255, 221, 0, 0.45), 0 5px 0 #D97706;
}

.toddler-btn.btn-clear {
  background: #FEE2E2;
  color: #DC2626;
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.3), 0 5px 0 #F87171;
}

.toddler-btn.btn-undo {
  background: #E0E7FF;
  color: #4338CA;
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.3), 0 5px 0 #818CF8;
}

/* Floating Bottom Chunky Color & Tool Docks */
.bottom-dock-area {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  z-index: 50;
  pointer-events: none;
}

.bottom-dock-area > * {
  pointer-events: auto;
}

/* Giant Color Crayons Carousel Bar */
.colors-dock {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 14px 28px;
  border-radius: 54px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0,0,0,0.08);
  max-width: 96vw;
  overflow-x: auto;
  scrollbar-width: none;
}
.colors-dock::-webkit-scrollbar {
  display: none;
}

/* Huge Toddler Color Circles */
.color-swatch {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 5px solid #FFFFFF;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.color-swatch:active {
  transform: scale(0.85);
}

.color-swatch.active {
  transform: scale(1.24) translateY(-8px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.32);
  border-color: #FFFFFF;
}

.color-swatch.active::after {
  content: '★';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FFFFFF;
  font-size: 28px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Tool Mode Selector (Crayon, Sparkle, Bucket, Eraser) */
.tools-dock {
  display: flex;
  align-items: center;
  gap: 18px;
}

.tool-chip {
  height: 68px;
  padding: 0 30px;
  border-radius: 34px;
  background: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 26px;
  font-weight: 800;
  color: #334155;
  box-shadow: 0 10px 22px rgba(0,0,0,0.14), 0 4px 0 #CBD5E1;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-chip:active {
  transform: scale(0.92);
}

.tool-chip.active {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.45), 0 4px 0 #1D4ED8;
  transform: scale(1.08);
}

/* Mascot Positioning (Larger and prominent on right side) */
.mascot-container {
  position: absolute;
  bottom: 220px;
  right: 32px;
  z-index: 60;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .toddler-btn {
    height: 68px;
    font-size: 24px;
    padding: 0 20px;
  }
  .color-swatch {
    width: 62px;
    height: 62px;
  }
  .tool-chip {
    height: 58px;
    font-size: 22px;
    padding: 0 22px;
  }
  .mascot-container {
    bottom: 200px;
    right: 18px;
  }
}
