@import url('https://fonts.googleapis.com/css2?family=Averia+Sans+Libre:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');



/* Base variables */
:root {
  --bg: #f3f3f3;
  --text: #1a1a1a;
  --muted: #525968;
  --accent: #000000;
  --border: #cdcdcd;
  --radius: 12px;
}

/* Reset & layout */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Averia Sans Libre", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  position: relative;
  box-shadow: none;
}

/* Prevent scrolling on main drawing page only */
body:not(.gallery-page) {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Content width and rhythm */
body > * {
  max-width: 72ch;
  padding-left: 24px;
  padding-right: 24px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 10;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Prevent overflow on desktop (except gallery) */
@media (min-width: 769px) {
  body:not(.gallery-page) {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100vh;
  }
  
  body:not(.gallery-page) .sketch {
    overflow: hidden;
    height: calc(100vh - 140px);
  }
  
  body:not(.gallery-page) .canvas-wrap {
    overflow: hidden;
  }
}

/* Header & nav */
header {
  position: sticky;
  top: 20;
  backdrop-filter: saturate(1.2) blur(8px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  z-index: 20;
  /* Override content width constraints */
  max-width: none !important;
  padding-left: 20 !important;
  padding-right: 20 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
  /* full-bleed */
  width: 100vw !important;
  padding: 12px 24px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Styling for the logo */
.logo {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s ease;
}

.logo:hover {
  color: var(--accent);
}



/* Full-width bottom border for header */
header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 1px;
  background: var(--border);
}

header button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  transition: all 160ms ease;
  display: inline-block;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

header button:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}

header button:active {
  transform: translateY(0);
}

header button a {
  color: inherit;
  text-decoration: none;
}

/* Icon buttons styling */
header button[title] {
  min-width: 40px;
  font-size: 18px;
  font-weight: bold;
  padding: 8px 12px;
}

/* Header sections */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Streak indicator */
.streak-indicator {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
  margin-left: 8px;
  margin-right: 8px;
  flex-shrink: 0; /* Prevent shrinking on mobile */
}

.streak-indicator.active {
  background: rgba(255, 107, 53, 0.1);
  color: #FF6B35;
  animation: gentle-pulse 2s ease-in-out infinite;
}

.streak-indicator.inactive {
  background: rgba(108, 123, 149, 0.1);
  color: #6C7B95;
}

@keyframes gentle-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.streak-indicator:hover {
  transform: scale(1.05);
}

/* Mode controls in prompt area */
.mode-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 0;
  max-width: 100%;
}

.mode-selector-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 600px;
}

.mode-selector-row .prompt {
  flex: 1;
  margin: 0;
  text-align: center;
}

.mode-selector-row button {
  flex-shrink: 0;
  margin-left: auto;
}

.mode-controls select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.mode-controls button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-selector-row button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: auto;
  height: auto;
  display: inline-block;
}

.mode-controls button:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}

.mode-controls button:active {
  transform: translateY(0);
}

.mode-controls .prompt {
  text-align: center;
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 100%;
  word-wrap: break-word;
  hyphens: auto;
}

/* Prompt controls - keeping for backward compatibility */
.prompt-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

#prompt-mode {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  transition: all 160ms ease;
}

#prompt-mode:hover {
  background: color-mix(in oklab, var(--accent) 4%, transparent);
  border-color: color-mix(in oklab, var(--accent) 20%, var(--border));
}

#prompt-mode:focus {
  outline: 2px solid color-mix(in oklab, var(--accent) 20%, transparent);
  outline-offset: 2px;
}

#new-prompt-btn {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  font-weight: 600;
}

#new-prompt-btn:hover {
  background: color-mix(in oklab, var(--accent) 85%, transparent);
  transform: translateY(-1px);
}

nav { padding: 12px 12px 12px 12px; }
nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
}
nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
  font-weight: 500;
  border: 1px solid var(--border);
}
nav a:hover {
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}
nav a:active { transform: translateY(1px); }

/* Typography */
h1 {
  margin: 32px auto 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(1.75rem, 2vw + 1rem, 3rem);
}

p {
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.125rem);
}

/* Prompt container with subtle dashed border */
.prompt-container {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Utilities */
.container {
  max-width: 1100px;
  padding-left: 24px;
  padding-right: 24px;
  padding-top: 24px;
  margin-left: auto;
  margin-right: auto;
}

.section { padding: 0; }

/* Nice focus styles */
:where(a, button, [tabindex]) {
  outline: none;
}
:where(a, button, [tabindex]):focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: 10px;
}


/* Sketch */
.sketch { padding-top: 0; }
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.toolbar input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.toolbar input[type="range"] { width: 140px; }

/* Small screens */
@media (max-width: 640px) {
  nav ul { flex-wrap: wrap; gap: 12px; }
  nav a { padding: 6px 10px; }
  h1 { margin-top: 24px; }
  
  /* Add mobile padding to body content */
  body > * {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  
  /* Mobile header - more touch-friendly */
  header {
    padding: 8px 20px;
    min-height: auto;
  }
  
  .header-left {
    flex-direction: row;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto; /* Allow horizontal scrolling if needed */
  }
  
  .header-right {
    align-items: center;
  }
  
  .mode-controls {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 0;
    align-items: center;
  }
  
  .mode-selector-row {
    gap: 8px;
  }
  
  .mode-controls select {
    font-size: 14px;
    padding: 6px 8px;
    min-width: 80px;
  }
  
  .mode-controls button {
    font-size: 14px;
    padding: 6px 12px;
    min-width: auto;
    height: auto;
  }
  
  .mode-controls .prompt {
    font-size: 16px;
    line-height: 1.3;
    padding: 0 16px;
  }
  
  .prompt-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  #prompt-mode {
    min-width: 100px;
    font-size: 0.7rem;
    padding: 3px 6px;
  }
  
  #new-prompt-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    min-width: auto;
  }
  
  .header-right button {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  
  .streak-indicator {
    font-size: 14px;
    padding: 6px 10px;
    margin-left: 4px;
    margin-right: 4px;
    min-width: 50px; /* Ensure minimum width for readability */
    text-align: center;
  }
  
  .logo {
    font-size: 1rem;
    margin-right: 6px;
  }
  
  
  .section {
    padding: 16px 0;
  }
  
  /* Optimize footer for mobile */
  footer {
    padding: 12px 16px;
  }
  
  /* Reduce prompt text size on mobile to save space */
  .prompt {
    font-size: 18px;
  }
}

/* Sketch */
.sketch { 
  padding-top: 0; 
  padding-bottom: 80px; /* Space for floating toolbar */
}

/* Floating Toolbar */
.toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  /* border-top: 1px solid var(--border); */
  z-index: 1000;
  padding: 12px 20px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 60px;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Show toolbar when colors are loaded */
.toolbar.colors-loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Loading indicator for toolbar */
.toolbar-loading {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toolbar-loading.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toolbar-loading.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toolbar-loading-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.toolbar input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.toolbar input[type="range"] { 
  width: 120px; 
  min-width: 80px;
}

/* Color Picker Container */
.color-picker-container {
  position: relative;
  display: inline-block;
}

/* Color Picker Button */
.color-picker-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 160ms ease;
  padding: 0;
  position: relative;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.color-picker-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-picker-btn:active {
  transform: translateY(0);
}

.current-color {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 160ms ease;
  flex-shrink: 0;
  display: block;
  aspect-ratio: 1;
}

/* Color Popup */
.color-popup {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  z-index: 1001;
  animation: fadeInUp 200ms ease;
  pointer-events: auto;
}

.color-popup-content {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}



/* Popup Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Tool Button */
.tool-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: var(--background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tool-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

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

.tool-btn.eraser {
  background: var(--error-light);
  border-color: var(--error);
}

/* Size Picker */
.size-picker-container {
  position: relative;
  display: inline-block;
}

.size-picker-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: var(--background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.size-picker-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

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

.size-popup {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  z-index: 1001;
  animation: fadeInUp 200ms ease;
  pointer-events: auto;
}

.size-popup-content {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.size-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  min-width: 50px;
}

.size-option {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  border: 2px solid var(--border);
  background: var(--background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  aspect-ratio: 1;
  flex-shrink: 0;
}

.size-option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.size-option.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.toolbar button {
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 160ms ease;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.toolbar button:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.toolbar button:active {
  transform: translateY(0);
}
.canvas-wrap {
  position: relative;
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f3f3;
  width: 100%;
  height: 100%;
  min-height: 400px;
  box-shadow: none;
}

/* Removed gradient effect for flat design */

/* Make the drawing area full-bleed across the viewport (in-page, not background) */
.sketch .canvas-wrap {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

#canvas {
  display: block;
  width: 100% !important;
  height: 70vh !important;
  min-height: 400px;
  touch-action: none;
  cursor: none;
  background: #f3f3f3;
  box-shadow: none;
}

/* Mobile-specific canvas sizing for better drawing experience */
@media (max-width: 768px) {
  #canvas {
    height: 85vh !important;
    min-height: 500px;
  }
  
  /* Ensure canvas container takes full width on mobile */
  .sketch .canvas-wrap {
    margin-top: 4px; /* Reduce top margin to save space */
  }
  
  /* Optimize body spacing on mobile */
  body > * {
    margin-bottom: 8px; /* Reduce spacing between elements */
  }
}

/* Extra large mobile screens (tablets in portrait) */
@media (max-width: 1024px) and (min-width: 769px) {
  #background-canvas {
    height: 80vh !important;
    min-height: 450px;
  }
  
  #canvas {
    height: 80vh !important;
    min-height: 450px;
  }
}

/* Very small mobile screens (older phones) - maximize drawing space */
@media (max-width: 480px) {
  #background-canvas {
    height: 90vh !important;
    min-height: 400px;
  }
  
  #canvas {
    height: 90vh !important;
    min-height: 400px;
  }
  
  /* Further reduce spacing on very small screens */
  .section {
    padding: 8px 0;
  }
  
  header {
    padding: 6px 0;
  }
  
  footer {
    padding: 16px 12px;
    margin-top: 24px;
  }
}

.brush-cursor {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  z-index: 100;
  transition: width 0.1s ease, height 0.1s ease;
}

/* Canvas stability improvements */
#canvas {
  /* Prevent canvas from being stretched by CSS */
  max-width: 100%;
  max-height: 100%;
  /* Ensure smooth resizing */
  transition: none;
  /* Prevent image smoothing that can cause blur */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
  /* Prevent scrolling and zooming only on main drawing page */
  body:not(.gallery-page) {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
  
  /* Ensure canvas takes available space */
  .sketch {
    height: calc(100vh - 140px); /* Account for header, prompt, and toolbar */
    height: calc(100dvh - 140px);
    padding-bottom: 0;
  }
  
  .canvas-wrap {
    height: 100%;
    width: 100%;
  }
  
  #canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
  }
  
  /* Toolbar adjustments */
  .toolbar {
    padding: 8px 16px;
    gap: 8px;
    min-height: 56px;
  }
  
  .toolbar label {
    font-size: 0.8rem;
  }
  
  .toolbar input[type="range"] {
    width: 100px;
    min-width: 60px;
  }
  
  .toolbar button {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 36px;
  }
  
  /* Hide labels on very small screens */
  @media (max-width: 480px) {
    .toolbar .label {
      display: none;
    }
    
    .toolbar {
      gap: 6px;
      padding: 6px 12px;
    }
    
    /* Color picker adjustments for small screens */
    .color-picker-btn {
      width: 36px;
      height: 36px;
    }
    
    .current-color {
      width: 20px;
      height: 20px;
      min-width: 20px;
      min-height: 20px;
      max-width: 20px;
      max-height: 20px;
    }
    
    .color-popup {
      margin-bottom: 4px;
    }
    
    .color-popup-content {
      padding: 8px;
    }
    
  
  .zen-color-palette {
    min-width: 50px;
    gap: 6px;
  }
  
  .tool-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .size-picker-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .size-options {
    min-width: 40px;
    gap: 4px;
  }
  
  .size-option {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    font-size: 10px;
    aspect-ratio: 1;
    flex-shrink: 0;
  }
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  .toolbar {
    padding: 10px 24px;
    gap: 16px;
  }
  
  .toolbar input[type="range"] {
    width: 140px;
  }
}

/* Large desktop adjustments */
@media (min-width: 1025px) {
  .toolbar {
    padding: 12px 32px;
    gap: 20px;
    flex-wrap: nowrap; /* Prevent stacking on large screens */
    justify-content: center;
  }
  
  .toolbar input[type="range"] {
    width: 160px;
  }
}



.prompt {
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: var(--muted);
  opacity: 0;
  filter: blur(12px);
  animation: promptReveal 5s ease forwards;
}

@keyframes promptReveal {
  0% { opacity: 0; filter: blur(12px); }
  100% { opacity: 1; filter: blur(0); }
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: color-mix(in oklab, var(--bg) 95%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  /* border-top: 1px solid var(--border); */
  padding: 16px 24px;
  z-index: 20;
  text-align: center;
}

footer .toolbar {
  justify-content: center;
  margin-bottom: 8px;
  position: sticky;
  bottom: 0;
  background: var(--bg);
  /* border-top: 1px solid var(--border); */
  z-index: 10;
  gap: 16px;
  padding: 12px 20px;
}

/* Remove labels from toolbar */
footer .toolbar .label {
  display: none;
}

/* Style toolbar buttons like gallery button */
footer .toolbar button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms ease;
}

footer .toolbar button:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border-color: var(--accent);
}

/* Zen-style range slider */
footer .toolbar input[type="range"] {
  width: 120px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

footer .toolbar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

footer .toolbar input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Feedback System */
.feedback-link {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-block;
}

/* Onboarding Modal Styles */
.onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    margin: 0;
}

.onboarding-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-out;
}

.onboarding-content p {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--text);
  line-height: 1.6;
  font-weight: 300;
}

.onboarding-content p:last-of-type {
  margin-bottom: 32px;
  font-style: italic;
  color: var(--accent);
}

.caption {
  font-size: 12px !important;
  color: var(--muted) !important;
  font-style: normal !important;
  margin: 16px 0 8px 0 !important;
  opacity: 0.7;
}

.modal-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 20px 0;
  opacity: 0.3;
}

.support-text {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin: 20px 0 24px 0;
  line-height: 1.5;
  opacity: 0.8;
}

.support-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.support-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: 16px;
}

.coffee-button-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFDD00; /* Buy Me a Coffee official yellow */
  color: #000;
  text-decoration: none;
  padding: 10px 20px; /* Smaller than Begin button */
  border-radius: 6px; /* Slightly smaller radius */
  font-weight: 500;
  font-size: 14px; /* Smaller than Begin button */
  box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.coffee-button-modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 221, 0, 0.4);
  background: #FFE600;
}

.coffee-button-modal span {
  font-size: 14px; /* Match smaller button text size */
}

.feedback-button-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  padding: 10px 20px; /* Smaller than Begin button */
  border-radius: 6px; /* Slightly smaller radius */
  font-weight: 500;
  font-size: 14px; /* Smaller than Begin button */
  font-family: 'Averia Sans Libre', cursive;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.feedback-button-modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: var(--text);
}

/* Modal floating animation - works with flexbox centering */
@keyframes modalFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(0.5deg);
  }
  50% {
    transform: translateY(-1px) rotate(0deg);
  }
  75% {
    transform: translateY(-2px) rotate(-0.3deg);
  }
}


.onboarding-close {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Averia Sans Libre', cursive;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
}

.onboarding-close:hover {
  background: color-mix(in oklab, var(--accent) 90%, black);
  transform: translateY(-1px);
}

/* Mobile adjustments for onboarding */
@media (max-width: 768px) {
  .onboarding-content {
    padding: 24px;
    margin: 20px;
  }
  
  .onboarding-content h2 {
    font-size: 24px;
  }
  
  .mode-item {
    padding: 10px;
  }
  
  .mode-icon {
    font-size: 20px;
    margin-right: 12px;
  }
}

/* Simple Feedback Modal */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    margin: 0;
    padding: 0;
}

.feedback-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.feedback-content h2 {
    margin: 0 0 20px 0;
    color: var(--text);
    font-size: 1.2rem;
}

.feedback-type {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.feedback-type label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.feedback-type label:hover {
    background: var(--muted);
}

.feedback-type input[type="radio"] {
    margin: 0;
}

.feedback-content textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
}

.feedback-content input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    margin-bottom: 20px;
}

.feedback-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.feedback-actions button {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.feedback-actions button[type="submit"] {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.feedback-actions button:hover {
    background: var(--muted);
}

.feedback-actions button[type="submit"]:hover {
    background: var(--accent);
    opacity: 0.9;
}


/* Zen-like animations */
@keyframes fadeIn {
  0% { 
    opacity: 0; 
  }
  100% { 
    opacity: 1; 
  }
}

@keyframes fadeOut {
  0% { 
    opacity: 1; 
  }
  100% { 
    opacity: 0; 
  }
}

@keyframes floatDrift {
  0%, 100% {
    transform: translateX(-50%) translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateX(-50%) translateY(-3px) rotate(0.5deg);
  }
  50% {
    transform: translateX(-50%) translateY(-1px) rotate(0deg);
  }
  75% {
    transform: translateX(-50%) translateY(-2px) rotate(-0.3deg);
  }
}

@keyframes cursorDrift {
  0% {
    transform: translateX(-50%) translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateX(-50%) translateY(0px) rotate(0deg);
  }
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: fadeIn 0.6s ease-out, floatDrift 3s ease-in-out infinite;
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--bg) 95%, transparent);
}

.toast.fade-out {
  animation: fadeOut 0.6s ease-out forwards;
}

/* Mobile toast styling */
@media (max-width: 640px) {
  .toast {
    min-width: 80vw;
    max-width: 90vw;
    padding: 16px 24px;
    font-size: 1rem;
    text-align: center;
  }
}

/* Footer styling */
footer {
  padding: 24px 12px;
  margin-top: 48px;
  text-align: center;
  position: relative;
  z-index: 5;
}

.coffee-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.coffee-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
  background: linear-gradient(135deg, #ff5252, #ff7043);
}

.coffee-button span {
  font-size: 1.1rem;
  animation: coffeePulse 2s ease-in-out infinite;
}

@keyframes coffeePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Mobile coffee button */
@media (max-width: 640px) {
  .coffee-button {
    padding: 14px 28px;
    font-size: 1rem;
  }
}

/* Location theming */
body.location-themed {
  background: var(--location-background, var(--bg));
  transition: background-color 0.3s ease;
}

body.location-themed .header {
  background: var(--location-primary, var(--accent));
  color: white;
  transition: background-color 0.3s ease;
}

body.location-themed .header h1 {
  color: white;
}

body.location-themed .location-display {
  color: var(--location-accent, white);
  opacity: 0.9;
}

body.location-themed .mode-selector-row button {
  background: var(--location-secondary, var(--accent));
  color: white;
  border: 1px solid var(--location-accent, var(--accent));
  transition: all 0.3s ease;
}

body.location-themed .mode-selector-row button:hover {
  background: var(--location-accent, var(--accent));
  transform: translateY(-1px);
}

body.location-themed .mode-selector-row button:disabled {
  background: var(--location-secondary, var(--accent));
  opacity: 0.5;
}

/* Removed canvas border to keep clean look */

body.location-themed .prompt {
  color: var(--location-text, var(--text));
  transition: color 0.3s ease;
}

/* Zen loading toast */
.zen-loading-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--text);
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--bg) 95%, transparent);
  max-width: 300px;
  min-width: 200px;
}

.zen-loading-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.zen-loading-toast.fade-out {
  animation: fadeOut 0.6s ease-out forwards;
}

.zen-loading-content {
  text-align: center;
  color: var(--text, #1a1a1a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.zen-loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.zen-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #000000);
  animation: zenPulse 1.4s ease-in-out infinite both;
}

.zen-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.zen-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.zen-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes zenPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.zen-loading-text {
  font-family: 'Averia Sans Libre', sans-serif;
  font-size: 14px;
  font-weight: 300;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

/* Mobile zen loading toast styling */
@media (max-width: 640px) {
  .zen-loading-toast {
    min-width: 80vw;
    max-width: 90vw;
    padding: 16px 24px;
    font-size: 1rem;
    text-align: center;
  }
}

/* Location-themed loading toast */
body.location-themed .zen-loading-toast {
  background: var(--location-background, var(--bg));
  border-color: var(--location-primary, var(--border));
  color: var(--location-text, var(--text));
}

body.location-themed .zen-loading-content {
  color: var(--location-text, var(--text));
}

body.location-themed .zen-dot {
  background: var(--location-primary, #000000);
}

/* Coordinate color for logo */
#logo {
  transition: color 0.3s ease;
}

/* Zen Location-Based Theming */
:root {
  --location-primary: #000000;
  --location-secondary: #333333;
  --location-accent: #666666;
  --location-background: #f3f3f3;
  --location-text: #000000;
}

/* Location-themed body */
body.location-themed {
  --location-primary: var(--location-primary);
  --location-secondary: var(--location-secondary);
  --location-accent: var(--location-accent);
  --location-background: var(--location-background);
  --location-text: var(--location-text);
}

/* Location-themed header - removed border to keep clean look */

/* Location-themed canvas - removed border to keep clean look */

/* Location-themed buttons */
body.location-themed button {
  transition: all 0.3s ease;
}

body.location-themed button:hover {
  background: var(--location-primary);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Location-themed toolbar - removed border to keep clean look */

/* Location-themed color picker - removed borders to keep clean look */

/* Location-themed popups */
body.location-themed .color-popup,
body.location-themed .size-popup {
  border: 1px solid var(--location-accent);
  box-shadow: 0 4px 20px color-mix(in oklab, var(--location-accent) 20%, transparent);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Location-themed location name */
body.location-themed .location-name {
  color: var(--location-primary);
  opacity: 0.7;
  transition: color 1s ease;
}

/* Location-themed logo */
body.location-themed #logo {
  color: var(--location-primary);
  transition: color 1s ease;
}

body.location-themed #logo:hover {
  color: var(--location-accent);
  transition: color 0.3s ease;
}

/* Shuffle button */
.shuffle-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  width: 100%;
}

.shuffle-btn:hover {
  background: var(--accent);
  color: var(--text);
  transform: scale(1.05);
}

.shuffle-btn.active {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 0 10px var(--accent);
}

/* Location permission toast */
.location-permission-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  max-width: 500px;
  width: 90%;
}

.location-permission-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.location-permission-toast.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

.location-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.location-toast-text {
  flex: 1;
  min-width: 0;
}

.location-toast-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.location-toast-description {
  color: var(--text);
  opacity: 0.8;
  font-size: 0.8rem;
  line-height: 1.3;
}

.location-toast-warning {
  color: #ff6b35;
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 4px;
  opacity: 0.9;
}

.location-toast-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.location-allow-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.location-allow-btn:hover {
  background: var(--accent);
  opacity: 0.9;
  transform: translateY(-1px);
}

.location-skip-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.location-skip-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
}

/* Location denied message */
.location-denied-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 24px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.location-denied-message.visible {
  opacity: 1;
}

.location-denied-message.fade-out {
  opacity: 0;
}

.location-denied-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-denied-icon {
  font-size: 20px;
}

.location-denied-text p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

/* Remove jarring hover effects */
.drawing-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.drawing-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* New Color Palette Bar Styles */
.color-palette-bar {
  display: flex;
  flex-direction: row; /* Horizontal stacking */
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 0; /* Remove bottom margin to align with buttons */
}

.zen-color-palette {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on very small screens */
  min-width: 0; /* Allow shrinking */
  overflow: visible; /* Ensure colors are always visible */
}

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

.action-buttons button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-buttons button:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}

.action-buttons button:active {
  transform: translateY(0);
}

.zen-color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  flex-shrink: 0; /* Prevent shrinking */
  min-width: 44px; /* Ensure minimum size */
  min-height: 44px;
}

.zen-color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.zen-color-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.3);
  animation: colorPulse 2s ease-in-out infinite;
}

.zen-color-swatch.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@keyframes colorPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Eraser Swatch */
.eraser-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.eraser-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.eraser-swatch.active {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3);
}

.eraser-swatch.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Size adjustment slider (appears on long press) */
.size-adjustment-slider {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: none;
}

.size-adjustment-slider.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.size-slider {
  width: 200px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.size-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .zen-color-swatch,
  .eraser-swatch {
    width: 36px;
    height: 36px;
    font-size: 14px; /* Smaller emoji for eraser */
  }
  
  .color-palette-bar {
    gap: 4px;
    margin-bottom: 12px;
  }
  
  .zen-color-palette {
    gap: 4px;
    flex-wrap: wrap; /* Allow wrapping on mobile */
    justify-content: center;
  }
  
  .zen-color-swatch {
    flex-shrink: 0; /* Prevent shrinking on mobile */
    min-width: 36px;
    min-height: 36px;
  }
  
  .action-buttons {
    gap: 8px;
  }
  
  .action-buttons button {
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* Force deployment */
