/* Chloe's Maker - flat sections, bright friendly colors, self-hosted fonts.
   Matches the routine app's .app-section style: hairline dividers, no
   boxed cards, no shadows. */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/fredoka.woff2') format('woff2');
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/baloo2.woff2') format('woff2');
}

:root {
  font-family: 'Baloo 2', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
body { margin: 0; }
.maker-app {
  background: radial-gradient(ellipse at top left, #fce7f0 0, transparent 55%),
    linear-gradient(160deg, #fffaf4, #faf6ff);
  min-height: 100vh;
  line-height: 1.6;
  color: #0f172a;
}
.maker-app main { max-width: 960px; margin: 0 auto; padding: 12px 12px 48px; }
@media (min-width: 1024px) { .maker-app main { max-width: 1080px; } }
.maker-app h1, .maker-app h2, .maker-app h3 {
  font-family: 'Fredoka', 'Baloo 2', sans-serif;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.maker-app button, .maker-app input, .maker-app textarea { min-width: 44px; min-height: 44px; }
.maker-app button { touch-action: manipulation; cursor: pointer; }
.maker-app button:disabled { cursor: not-allowed; opacity: 0.6; }
.maker-app button:focus-visible, .maker-app a:focus-visible,
.maker-app input:focus-visible, .maker-app textarea:focus-visible {
  outline: 3px solid #9d174d; outline-offset: 2px;
}
.maker-app button:active { transform: scale(0.985); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Header */
.maker-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px 4px;
}
.maker-header h1 { font-size: 1.9rem; margin: 0; }
.maker-tagline { margin: 2px 0 0; color: #536176; font-size: 1rem; }
.maker-dragon { flex-shrink: 0; }
.maker-star { margin-left: auto; flex-shrink: 0; }

/* Flat section: hairline top divider, no box, compact padding. */
.app-section {
  background: transparent; border: 0;
  border-top: 1px solid rgb(226 232 240 / 0.65);
  border-radius: 0; box-shadow: none;
  padding: 1rem 0.5rem;
}
@media (min-width: 640px) { .app-section { padding: 1rem 1.5rem; } }
.app-section h2 { font-size: 1.25rem; margin: 0 0 4px; }
.maker-hint { margin: 0 0 10px; color: #536176; font-size: 0.95rem; }

/* Idea box */
.maker-idea-row { display: flex; gap: 8px; align-items: stretch; }
.maker-idea-row textarea, .maker-idea-row input {
  flex: 1; font-family: inherit; font-size: 1.05rem; line-height: 1.5;
  padding: 10px 12px; border: 2px solid #9cc8dc; border-radius: 16px;
  background: #fff; color: #0f172a; resize: vertical;
}
.maker-mic {
  flex-shrink: 0; width: 52px; font-size: 1.5rem;
  border: 2px solid #9cc8dc; border-radius: 16px; background: #ddeff7;
}
.maker-mic.listening { background: #fde68a; border-color: #f59e0b; }
.maker-mic-note { margin: 6px 0 0; color: #92400e; font-weight: 700; }
.maker-big-btn {
  display: block; width: 100%; margin-top: 10px;
  min-height: 52px; font-family: 'Fredoka', sans-serif; font-size: 1.25rem; font-weight: 700;
  color: #fff; background: #0369a1; border: 0; border-radius: 16px;
}
.maker-big-btn:hover { background: #025a8a; }
.maker-status { margin: 8px 0 0; min-height: 1.4em; color: #536176; font-weight: 600; }
.maker-status.error { color: #b91c1c; }

/* Typing/building dots */
@keyframes maker-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.maker-dot {
  width: 8px; height: 8px; border-radius: 9999px; background: #0369a1;
  display: inline-block; animation: maker-bounce 1.2s ease-in-out infinite;
}
.maker-dot:nth-child(2) { animation-delay: 0.15s; }
.maker-dot:nth-child(3) { animation-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) { .maker-dot { animation: none; } }

/* Starter cards: flat, colorful washes, no shadows. */
.maker-starters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .maker-starters { grid-template-columns: repeat(4, 1fr); } }
.maker-starter {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  gap: 2px; padding: 12px; border: 1px solid #decfdf; border-radius: 16px;
  background: #fffdfb; color: #0f172a; font-family: inherit;
}
.maker-starter:hover { background: #fce7f0; border-color: #b66b91; }
.maker-starter-emoji { font-size: 1.8rem; line-height: 1.2; }
.maker-starter-title { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1rem; }
.maker-starter-desc { font-size: 0.85rem; color: #536176; line-height: 1.35; }

/* Preview */
.maker-preview-wrap {
  border: 2px solid #9cc8dc; border-radius: 16px; overflow: hidden;
  background: #fff;
}
#game-frame { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
@media (min-width: 640px) { #game-frame { height: 560px; } }
.maker-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.maker-btn {
  flex: 1; min-height: 48px; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1rem;
  color: #2c6480; background: #ddeff7; border: 1px solid #9cc8dc; border-radius: 16px;
}
.maker-btn:hover { background: #c9e6f2; }

/* My games */
.maker-games { list-style: none; margin: 0; padding: 0; }
.maker-games li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-top: 1px solid rgb(226 232 240 / 0.65);
}
.maker-games li:first-child { border-top: 0; }
.maker-game-info { flex: 1; min-width: 0; }
.maker-game-title { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1rem; }
.maker-game-meta { font-size: 0.85rem; color: #536176; }
.maker-game-play {
  flex-shrink: 0; padding: 8px 16px; min-height: 44px;
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  color: #fff; background: #0369a1; border: 0; border-radius: 999px;
}
.maker-game-delete {
  flex-shrink: 0; padding: 8px 12px; min-height: 44px;
  font-size: 1.1rem; color: #64748b; background: transparent; border: 0;
}

.maker-footer { padding: 16px 8px 0; color: #536176; font-size: 0.9rem; text-align: center; }
.maker-footer a { color: #0369a1; font-weight: 700; }
.maker-footer p { margin: 4px 0; }

/* Maker progress: stars, level, streak chip. */
.maker-progress {
  display: inline-block; margin: 6px 4px 2px; padding: 6px 14px;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1rem;
  color: #713f12; background: #fef3c7; border: 1px solid #fde68a; border-radius: 999px;
}

/* Skydragon buddy bubble. */
.maker-dragon-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px 2px; }
.maker-dragon-small { flex-shrink: 0; }
.maker-bubble {
  flex: 1; margin: 0; padding: 10px 14px; font-size: 1rem; line-height: 1.45;
  color: #0f172a; background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 4px 16px 16px 16px;
}

/* Learn to build: project cards reuse the starter look. */
.maker-projects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .maker-projects { grid-template-columns: repeat(3, 1fr); } }
.maker-project {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  gap: 2px; padding: 12px; border: 1px solid #decfdf; border-radius: 16px;
  background: #fffdfb; color: #0f172a; font-family: inherit;
}
.maker-project:hover { background: #e0f2fe; border-color: #0369a1; }
.maker-project-done { background: #fef9c3; border-color: #facc15; }

/* Project player: one step at a time. */
.maker-player { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgb(226 232 240 / 0.65); }
.maker-player h3 { font-size: 1.15rem; margin: 0 0 2px; }
.maker-step-label { margin: 0 0 4px; font-weight: 700; color: #0369a1; }
.maker-player-goal { margin: 0 0 10px; color: #0f172a; }
.maker-learned {
  margin: 10px 0 0; padding: 10px 12px;
  background: #dcfce7; border: 1px solid #86efac; border-radius: 16px;
}
.maker-learned p { margin: 0; }

/* How it works: labeled parts, try-it, code view. */
.maker-subhead { font-size: 1.1rem; margin: 14px 0 4px; }
.maker-parts { margin: 0 0 4px; padding-left: 20px; }
.maker-parts li { margin: 4px 0; }
.maker-tryit { display: flex; flex-direction: column; gap: 8px; }
.maker-tryit-card {
  padding: 10px 12px; background: #fef9c3; border: 1px solid #fde68a; border-radius: 16px;
}
.maker-tryit-text { margin: 0 0 8px; font-weight: 600; }
.maker-tryit-btn {
  min-height: 44px; padding: 8px 18px; font-family: 'Fredoka', sans-serif; font-weight: 700;
  color: #fff; background: #0369a1; border: 0; border-radius: 999px;
}
.maker-tryit-btn:disabled { background: #16a34a; }
.maker-tryit-undo {
  min-height: 44px; padding: 8px 14px; margin-left: 8px;
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  color: #536176; background: transparent; border: 1px solid #cbd5e1; border-radius: 999px;
}
.maker-code {
  max-height: 320px; overflow: auto; margin: 0; padding: 12px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  color: #0f172a; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px;
}
.maker-num { background: #fef08a; border-radius: 4px; padding: 0 2px; }
.maker-color { background: #fce7f3; border-radius: 4px; padding: 0 2px; }

/* Share link: shown after Show Dad / Show Mom so the link can be copied by hand too. */
.maker-share-link {
  width: 100%; box-sizing: border-box; margin-top: 10px; padding: 10px 12px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.85rem;
  border: 2px solid #9cc8dc; border-radius: 16px; background: #fff; color: #0f172a;
}

/* Remix button in My games and apps. */
.maker-game-remix {
  flex-shrink: 0; padding: 8px 14px; min-height: 44px;
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  color: #2c6480; background: #ddeff7; border: 1px solid #9cc8dc; border-radius: 999px;
}
