/* public/styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=VT323&display=swap');

:root {
  --color-paper: #ffecbf;
  --color-ink: #18181b;
  --color-accent: #f2a7b3;
  --color-accent-2: #f2c46d;
  --color-accent-3: #8ccf9a;
  --color-gridline: rgba(24, 24, 27, 0.06);
  --font-display: 'VT323', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
}

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

body {
  background-color: #fdf6ee;
  color: var(--color-ink);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Layout Utilities */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  width: 100%;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.w-full { width: 100%; }
.shrink-0 { flex-shrink: 0; }
.text-center { text-align: center; }

/* Spacing Utilities */
.p-6 { padding: 1.5rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-6 { padding-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-sm { max-width: 24rem; }

/* Soft UI Surfaces */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 32px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05), 0 20px 25px -5px rgba(0, 0, 0, 0.05);
  padding: 2rem 1.5rem;
  position: relative;
}

.solid-card {
  background: white;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05), 0 10px 15px -3px rgba(0,0,0,0.05);
  padding: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .btn {
    width: auto;
  }
}

.btn:active {
  transform: scale(0.96);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--color-ink);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
}

.btn-secondary {
  background-color: white;
  color: #3f3f46;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1), 0 4px 6px -1px rgba(0,0,0,0.05);
}

.btn-accent {
  background-color: var(--color-accent);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(242, 167, 179, 0.4);
}

/* Typography */
h1 { font-size: 2.25rem; font-weight: 700; color: #18181b; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 1.5rem; font-weight: 700; color: #18181b; }
h3 { font-size: 1.125rem; font-weight: 700; color: #18181b; }
p { font-size: 1rem; color: #71717a; line-height: 1.5; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #52525b;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.message-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: #3f3f46;
}

/* Tree Timeline */
.timeline {
  position: relative;
  padding: 1rem 0;
}
.timeline-line {
  position: absolute;
  left: 19px;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: #e4e4e7;
  z-index: 0;
}
.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
  z-index: 1;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Forms & Canvas */
.canvas-grid {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  grid-template-rows: repeat(32, 1fr);
  gap: 0px;
  background-color: #e4e4e7;
  padding: 8px;
  border-radius: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), inset 0 0 0 1px rgba(0,0,0,0.05);
  width: 100%;
  aspect-ratio: 1/1;
  touch-action: none;
}

.canvas-cell {
  background-color: white;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: background-color 0.1s;
}

textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  border: none;
  background: #fafafa;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), inset 0 0 0 1px rgba(0,0,0,0.05);
  resize: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #3f3f46;
}
textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

/* Palette */
.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active {
  box-shadow: 0 0 0 2px white, 0 0 0 4px #18181b;
  transform: scale(1.1);
}

.brush-size {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
  color: #a1a1aa;
  transition: all 0.2s;
}
.brush-size:hover { transform: scale(1.1); }
.brush-size.active {
  box-shadow: 0 0 0 2px white, 0 0 0 4px #18181b;
  color: #18181b;
  transform: scale(1.1);
}

.progress-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 2rem;
}
.progress-step {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e4e4e7;
  transition: background 0.3s;
}
.progress-step.active {
  background: var(--color-accent);
}

/* Mini pixel renderer */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  grid-template-rows: repeat(32, 1fr);
  gap: 0px;
  background-color: #f4f4f5;
  padding: 4px;
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1/1;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.mini-cell {
  border-radius: 1px;
}
