/* Daydream v31 — kid-first redesign (Remmy: cleanup.md, create-flow.md, grass-timer.md).
   Intrinsic layout (Kevin Powell): tokens.css spacing, min()/clamp(), container queries, no viewport breakpoints.
   Loaded after app.css; only layers over it. */
:root {
  --grass-h: 0px;
  --dd-bg: #0f1114;
  --dd-ink: #e8e6e1;
  --dd-ink-2: #c9ccd1;
  --dd-ink-3: #9aa0a6;
  --dd-line: #22262c;
  --dd-edge: #3a4048;
  --dd-surface: #171a1f;
  --dd-green: #5cb85c;
  --dd-green-hi: #8fd88f;
  --dd-green-lo: #3b8a3b;
  --dd-green-ink: #0b1a0b;
  --dd-amber: #e0a84a;
  --dd-blue: #5aa9ff;
  --dd-red: #d9534f;
  --dd-red-ink: #ff7b77;
  --dd-pad: max(24px, var(--gutter, 24px));
  --dd-px: "Press Start 2P", "Pixelify Sans", monospace;
  --dd-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html[data-who="kate"] {
  --dd-bg: #faf7f2; --dd-ink: #2a2622; --dd-ink-2: #4a443d; --dd-ink-3: #7a7268;
  --dd-line: #e6dfd4; --dd-edge: #cfc6b8; --dd-surface: #ffffff; --dd-green-ink: #0b1a0b;
}

html, body { background: var(--dd-bg); }
body {
  max-width: none;
  font-family: var(--dd-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--dd-ink);
  padding-bottom: calc(var(--grass-h) + 24px);
}
.void { display: none; }
.px { font-family: var(--dd-px); letter-spacing: .02em; font-weight: 400; }

/* ---------- 56px top bar: ◀ Store · DAYDREAM · Calvin ▾ ---------- */
.dirt-bar, html[data-who] .dirt-bar {
  background: color-mix(in srgb, var(--dd-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--dd-line);
  box-shadow: none;
}
.dirt-bar-inner {
  min-height: 56px;
  padding: 0 var(--dd-pad);
  gap: var(--space-3, 12px);
  max-width: var(--measure-wide, 1040px);
  margin-inline: auto;
}
.dirt-bar .grass-block, .dirt-bar .dirt-block { display: none; }
.logo, html[data-who] .logo {
  font-family: var(--dd-px);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--dd-ink);
  text-shadow: none;
}
.store-btn, .back-btn, html[data-who] .store-btn, html[data-who] .back-btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--dd-ink-3);
  font: 600 14px/1 var(--dd-body);
  text-decoration: none;
  text-shadow: none;
}
.back-btn .chev { font-size: 14px; }
.back-btn::after { content: " Back"; }

.who-menu { position: relative; margin: 0; flex-shrink: 0; }
.who-menu > summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  color: var(--dd-ink-2);
  font: 600 15px/1 var(--dd-body);
}
.who-menu > summary::-webkit-details-marker { display: none; }
.who-caret { color: var(--dd-ink-3); font-size: 12px; }
.who-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 180px;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: var(--dd-surface);
  border: 1px solid var(--dd-edge);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}
.who-pop button {
  min-height: 44px;
  text-align: left;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--dd-ink);
  font: 600 15px/1 var(--dd-body);
  cursor: pointer;
  text-decoration: none;
}
.who-pop button:hover, .who-pop button:focus-visible { background: var(--dd-line); }
.who-pop .studio-mark { display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: 8px 12px 4px; }
.who-pop .studio-name, .who-pop .ver-chip, html[data-who] .who-pop .ver-chip {
  font: 400 13px/1 var(--dd-body);
  color: var(--dd-ink-3);
  background: none; border: 0; box-shadow: none; text-shadow: none; min-height: 0; min-width: 0; padding: 0;
}

/* ---------- Home ---------- */
main { padding: 0; }
.dd-home, #view-build {
  container-type: inline-size;
  width: min(100% - 2 * var(--dd-pad), var(--measure, 640px));
  margin-inline: auto;
  padding-block: var(--space-7, 48px) var(--space-6, 32px);
}
.dd-home > * + * { margin-top: var(--space-7, 48px); }
.dd-hero > * + * { margin-top: var(--space-2, 8px); }
.dd-hi {
  margin: 0;
  font-size: clamp(20px, 4.2cqi, 28px);
  line-height: 1.4;
  color: var(--dd-ink);
}
.dd-sub { margin: 0; color: var(--dd-ink-3); }
.dd-hero .dd-actions { margin-top: var(--space-6, 32px); display: grid; gap: var(--space-3, 12px); }

.dd-build, .dd-go {
  display: flex;
  align-items: center;
  gap: var(--space-4, 16px);
  width: 100%;
  min-height: 64px;
  padding: var(--space-5, 24px);
  border: 0;
  border-radius: 4px;
  background: var(--dd-green);
  color: var(--dd-green-ink);
  font-family: var(--dd-px);
  font-size: clamp(14px, 3cqi, 18px);
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset -4px -4px 0 var(--dd-green-lo), inset 4px 4px 0 var(--dd-green-hi), 0 4px 0 #1d3d1d;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.dd-build:hover, .dd-go:hover { filter: brightness(1.05); }
.dd-build:active, .dd-go:active { transform: translateY(3px); box-shadow: inset -4px -4px 0 var(--dd-green-lo), inset 4px 4px 0 var(--dd-green-hi), 0 1px 0 #1d3d1d; }
.dd-build:focus-visible, .dd-go:focus-visible, .dd-play-last:focus-visible { outline: 3px solid var(--dd-blue); outline-offset: 3px; }
.dd-build small { display: block; margin-top: var(--space-2, 8px); font: 500 15px/1.4 var(--dd-body); }
.dd-ico { width: 48px; height: 48px; flex-shrink: 0; image-rendering: pixelated; }

.dd-play-last {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: var(--space-4, 16px);
  border: 2px solid var(--dd-edge);
  border-radius: 8px;
  color: var(--dd-ink);
  font: 600 17px/1.3 var(--dd-body);
  text-decoration: none;
}
.dd-play-last:hover { border-color: var(--dd-ink-3); }

/* Wide containers: Build + Play sit side by side, Build stays the focal (2fr). */
@container (min-width: 560px) {
  .dd-hero .dd-actions { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  /* Build and Play each keep their label on one line: side by side when both fit, otherwise
     Play wraps under Build at full width (flex-wrap, no breakpoint). */
  .dd-hero .dd-actions:has(.dd-play-last:not(.hidden)) { display: flex; flex-wrap: wrap; }
  .dd-hero .dd-actions:has(.dd-play-last:not(.hidden)) > .dd-build { flex: 2 1 max-content; }
  .dd-hero .dd-actions:has(.dd-play-last:not(.hidden)) > .dd-play-last { flex: 1 0 max-content; }
  .dd-play-last { justify-content: center; text-align: center; white-space: nowrap; }
  .dd-build > span { white-space: nowrap; }
  .dd-build small { white-space: normal; }
}

.eyebrow, .dd-games .view-title, html[data-who] .dd-games .view-title {
  margin: 0 0 var(--space-2, 8px);
  font: 700 13px/1.4 var(--dd-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dd-ink-3);
  text-shadow: none;
}
.dd-rows { list-style: none; margin: 0; padding: 0; }
.dd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--space-3, 12px);
  min-height: 56px;
  padding-block: var(--space-2, 8px);
  border-bottom: 1px solid var(--dd-line);
}
.dd-row.is-archived { opacity: .6; }
.dd-row-name, html[data-who] .dd-row-name {
  flex: 1 1 12rem;
  min-width: 0;
  padding-block: 8px;
  color: var(--dd-ink);
  font: 500 17px/1.35 var(--dd-body);
  text-decoration: none;
  text-shadow: none;
}
.dd-row .card-who { flex-basis: 100%; order: 3; margin-top: -8px; font-size: 13px; color: var(--dd-ink-3); }
.dd-row-end { display: inline-flex; align-items: center; gap: var(--space-1, 4px); margin-left: auto; }
.dd-row-play {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--dd-green);
  font: 700 17px/1 var(--dd-body);
  text-decoration: none;
}
.dd-row-state { padding: 0 12px; color: var(--dd-ink-3); font: 500 15px/1 var(--dd-body); text-decoration: none; }
a.dd-row-state { min-height: 44px; display: inline-flex; align-items: center; color: var(--dd-ink-2); }
.dd-row-state.is-building { color: var(--dd-amber); }

.dd-more-menu { position: relative; }
.dd-more-menu > summary {
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--dd-ink-3);
  font-size: 20px;
}
.dd-more-menu > summary::-webkit-details-marker { display: none; }
.dd-more-menu[open] > summary, .dd-more-menu > summary:hover { background: var(--dd-line); color: var(--dd-ink); }
.dd-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 15;
  min-width: 160px;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--dd-surface);
  border: 1px solid var(--dd-edge);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}
.dd-pop button, html[data-who] .dd-pop button {
  min-height: 44px;
  padding: 0 12px;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: none;
  box-shadow: none;
  color: var(--dd-ink);
  font: 600 15px/1 var(--dd-body);
  text-shadow: none;
  cursor: pointer;
}
.dd-pop button:hover { background: var(--dd-line); }

.dd-link, html[data-who] .dd-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--space-4, 16px);
  margin-right: var(--space-5, 24px);
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--dd-ink-3);
  font: 500 15px/1 var(--dd-body);
  text-shadow: none;
  cursor: pointer;
}
.dd-link:hover { color: var(--dd-ink); }
.dd-link[hidden] { display: none; }
.empty-panel { padding-block: var(--space-4, 16px); color: var(--dd-ink-3); }
.empty-panel .empty-copy { margin: 0; }

/* Old card layout from app.css must not leak into the rows. */
.dd-rows .project-item { flex-direction: row; }
.dd-rows .card-name { margin: 0; word-break: normal; }

/* Grown-up stuff stays out of the kid view. */
.review-chip { display: none !important; }
html[data-who="graham"] #view-home .review-chip:not([hidden]), html[data-who="kate"] #view-home .review-chip:not([hidden]) { display: block !important; }
.dd-quickadd { display: none; }
html[data-who="graham"] .dd-quickadd, html[data-who="kate"] .dd-quickadd { display: block; }
.dd-quickadd > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--dd-ink-3); font-size: 15px; }
.dd-quickadd .new-form { display: grid; gap: var(--space-3, 12px); padding-top: var(--space-3, 12px); }
.quota-bar { margin-top: var(--space-6, 32px) !important; }
.quota-label { font: 500 13px/1.4 var(--dd-body); color: var(--dd-ink-3); text-shadow: none; }

/* ---------- Dad: play time ---------- */
.dd-playtime .meta { margin: 0 0 var(--space-3, 12px); color: var(--dd-ink-3); font-size: 14px; }
#dd-playtime-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0 var(--space-6, 32px); }
.dd-pt-row { padding-block: var(--space-5, 24px); border-bottom: 1px solid var(--dd-line); }
.dd-pt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: var(--space-3, 12px); }
.dd-pt-name { font: 600 18px/1.3 var(--dd-body); }
.dd-pt-track { height: 8px; border-radius: 4px; overflow: hidden; background: var(--dd-line); margin-bottom: var(--space-4, 16px); }
.dd-pt-track i { display: block; height: 100%; background: var(--dd-green); }
.dd-pt-row.is-grounded .dd-pt-track i { width: 100% !important; background: var(--dd-red); }
.dd-pt-row.is-grounded .dd-pt-meta, .dd-pt-hint { color: var(--dd-red-ink); }
.dd-pt-act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dd-pt-hint { font-size: 14px; }
.dd-ground {
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--dd-red);
  border-radius: 8px;
  background: none;
  color: var(--dd-red-ink);
  font: 600 15px/1 var(--dd-body);
  cursor: pointer;
}
.dd-ground[aria-pressed="true"] { background: var(--dd-red); color: #fff; }

/* ---------- Build a game ---------- */
#view-build { padding-block: var(--space-6, 32px) 0; }
.dd-step {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 56px - var(--grass-h) - 24px - var(--space-6, 32px));
  padding-bottom: var(--space-5, 24px);
}
.dd-prog { display: flex; gap: 4px; margin-bottom: var(--space-2, 8px); }
.dd-prog i { flex: 1; height: 12px; background: var(--dd-line); box-shadow: inset -2px -2px 0 rgba(0,0,0,.25); }
.dd-prog i.on { background: var(--dd-green); box-shadow: inset -2px -2px 0 var(--dd-green-lo), inset 2px 2px 0 var(--dd-green-hi); }
.dd-stepl { margin: 0 0 var(--space-7, 48px); color: var(--dd-ink-3); font-size: 13px; }
.dd-step-ico { width: 64px; height: 64px; image-rendering: pixelated; margin-bottom: var(--space-5, 24px); flex-shrink: 0; }
.dd-step-ico.sm { width: 40px; height: 40px; margin: 0; }
.dd-step-ico.lg { width: 96px; height: 96px; align-self: center; }
.dd-title { margin: 0 0 var(--space-3, 12px); font-size: clamp(18px, 3.6cqi, 24px); line-height: 1.5; color: var(--dd-ink); text-shadow: none; }
.dd-step > .dd-sub { margin-bottom: var(--space-6, 32px); }
.dd-input {
  width: 100%;
  padding: var(--space-4, 16px);
  border: 2px solid var(--dd-edge);
  border-radius: 8px;
  background: var(--dd-surface);
  color: var(--dd-ink);
  font: 400 18px/1.5 var(--dd-body);
}
textarea.dd-input { min-height: 120px; resize: vertical; }
.dd-input:focus { outline: none; border-color: var(--dd-blue); }
.dd-input + .dd-input, .dd-chips + .dd-input { margin-top: var(--space-4, 16px); }
.dd-chips { display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); }
.dd-chip {
  min-height: 48px;
  padding: 8px 16px;
  border: 2px solid var(--dd-edge);
  border-radius: 8px;
  background: none;
  color: var(--dd-ink);
  font: 500 16px/1.2 var(--dd-body);
  cursor: pointer;
}
.dd-chip.sel { border-color: var(--dd-blue); color: var(--dd-blue); }
.dd-snap { align-self: flex-start; min-height: 44px; margin-top: var(--space-5, 24px); padding: 0; border: 0; background: none; color: var(--dd-blue); font: 500 16px/1.3 var(--dd-body); cursor: pointer; }
.dd-msg { min-height: 1.4em; margin: var(--space-2, 8px) 0 0; color: var(--dd-amber); font-size: 15px; }
.dd-sp { flex: 1; min-height: var(--space-6, 32px); }
.dd-go { justify-content: center; text-align: center; }
.dd-go[disabled] { opacity: .45; cursor: default; filter: grayscale(.4); transform: none; }
.dd-path { list-style: none; margin: 0; padding: 0; }
.dd-path li { display: flex; align-items: center; gap: var(--space-4, 16px); padding-block: var(--space-4, 16px); border-bottom: 1px solid var(--dd-line); font-size: 18px; }
.dd-path .n { width: 20px; color: var(--dd-green); font-size: 12px; }
.dd-done { text-align: center; padding-top: var(--space-6, 32px); }
.dd-done .dd-sub { margin-bottom: var(--space-2, 8px); }
.dd-stat { display: flex; justify-content: center; gap: 12px; margin: var(--space-5, 24px) 0; }
.dd-stat i { width: 16px; height: 16px; background: var(--dd-green); }
.dd-stat i.w { background: var(--dd-amber); }
.dd-stat i.o { background: var(--dd-line); }
.dd-stat-l { margin: 0 0 var(--space-2, 8px); color: var(--dd-ink-3); font-size: 15px; }
/* Wide container: the 4-step path reads as two columns; button keeps the measure. */
@container (min-width: 560px) {
  .dd-path { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); column-gap: var(--space-6, 32px); }
}

/* ---------- Project page sits on the same calm column ---------- */
#view-project { width: min(100% - 2 * var(--dd-pad), var(--measure-wide, 1040px)); margin-inline: auto; padding-block: var(--space-6, 32px); }
.foot { width: min(100% - 2 * var(--dd-pad), var(--measure, 640px)); margin-inline: auto; }
html:not([data-who="graham"]):not([data-who="kate"]) .foot { display: none; }

/* ---------- Touch grass ---------- */
#grass {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 0;
  z-index: 40;
  pointer-events: none;
  transition: height 1s linear;
  background: linear-gradient(#86c45c 0 8px, #5d9c3f 8px 16px, #7a5230 16px);
  -webkit-mask: linear-gradient(90deg, #000 0 50%, transparent 0) top/16px 4px repeat-x, linear-gradient(#000, #000) 0 4px/100% 100% no-repeat;
          mask: linear-gradient(90deg, #000 0 50%, transparent 0) top/16px 4px repeat-x, linear-gradient(#000, #000) 0 4px/100% 100% no-repeat;
}
html:not([data-who="calvin"]):not([data-who="miles"]) #grass,
html:not([data-who="calvin"]):not([data-who="miles"]) #dd-pause { display: none !important; }
#dd-pause {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-5, 24px);
  padding-bottom: calc(var(--grass-h) * .5);
  background: rgba(10, 12, 14, .35);
  opacity: 0;
}
#dd-pause.on { display: flex; animation: dd-fade .8s ease forwards; }
@keyframes dd-fade { from { opacity: 0; } to { opacity: 1; } }
.dd-pause-card {
  width: min(100%, 360px);
  margin-bottom: var(--space-5, 24px);
  padding: var(--space-6, 32px) var(--space-5, 24px);
  text-align: center;
  background: var(--dd-surface);
  border: 2px solid var(--dd-edge);
  border-radius: 12px;
}
.dd-pause-card h3 { margin: 0 0 var(--space-4, 16px); font-size: 16px; line-height: 1.6; color: #86c45c; }
.dd-pause-card p { margin: 0 0 var(--space-2, 8px); color: var(--dd-ink-2); }
html.dd-paused, html.dd-paused body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  #grass { transition: none !important; }
  #dd-pause.on { animation: none; opacity: 1; }
  .dd-build, .dd-go { transition: none; }
}
.dd-games .dd-link { width: auto; }
.quota-track, html[data-who] .quota-track { height: 4px; border: 0; border-radius: 2px; background: var(--dd-line); box-shadow: none; }
.quota-fill, html[data-who] .quota-fill { background: var(--dd-ink-3); box-shadow: none; }

/* ---------- v32: Remmy review of v31 ---------- */
/* 1. Pad ring only when focus is visible (keyboard/pad), never at rest. */
html:not(.pad-active) .pad-focus:not(:focus-visible) { outline: none !important; }
html:not(.pad-active) .pad-focus:focus-visible:not(:focus-visible) { outline: none !important; }
html:not(.pad-active) .pad-focus { outline: none !important; box-shadow: none !important; transform: none !important; }
html:not(.pad-active) .dd-build.pad-focus, html:not(.pad-active) .dd-go.pad-focus {
  box-shadow: inset -4px -4px 0 var(--dd-green-lo), inset 4px 4px 0 var(--dd-green-hi), 0 4px 0 #1d3d1d !important;
}
html.pad-active .pad-focus, .pad-focus:focus-visible:not(:focus) { outline: 4px solid #ffe566 !important; outline-offset: 4px; }
.dd-build:focus-visible, .dd-go:focus-visible { outline: 3px solid var(--dd-blue) !important; outline-offset: 3px; }

/* 2. Every row keeps a ⋯ slot so Play lines up. */
.dd-more-slot { display: inline-block; width: 44px; height: 44px; flex-shrink: 0; }

/* 3. Home: two intrinsic columns when there is room (hero | My games); everything else spans. */
.dd-home {
  width: min(100% - 2 * var(--dd-pad), var(--measure-wide, 1040px));
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: var(--space-7, 48px) var(--space-8, 64px);
  align-items: start;
}
.dd-home > * + * { margin-top: 0; }
.dd-home > :not(.dd-hero):not(.dd-games) { grid-column: 1 / -1; }
.dd-home > [hidden], .dd-home > .hidden { display: none !important; }
.dd-hero, .dd-games { max-width: var(--measure, 640px); width: 100%; justify-self: center; }
.dd-home .quota-bar { margin-top: 0 !important; }

/* 4. Build steps: question left, answer right in wide (landscape) containers; Next pinned, 48px off the grass. */
#view-build { width: min(100% - 2 * var(--dd-pad), var(--measure-wide, 1040px)); }
.dd-step { max-width: var(--measure, 640px); margin-inline: auto; padding-bottom: var(--space-7, 48px); }
.dd-q, .dd-a { display: flex; flex-direction: column; min-width: 0; }
@container (min-width: 900px) {
  .dd-step:not(.dd-done) {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-rows: auto 1fr auto;
    column-gap: var(--space-8, 64px);
  }
  .dd-step:not(.dd-done) .dd-q { grid-column: 1; grid-row: 1 / 3; }
  .dd-step:not(.dd-done) .dd-a { grid-column: 2; grid-row: 1; padding-top: 20px; }
  .dd-step:not(.dd-done) .dd-sp { grid-column: 1 / -1; grid-row: 2; }
  .dd-step:not(.dd-done) .dd-go { grid-column: 2; grid-row: 3; }
  .dd-step:not(.dd-done) .dd-path { display: block; }
}

/* 5. Grass with pixel character: blade tips, 3 dirt shades, a few flowers + pebbles. */
#grass {
  background:
    linear-gradient(#f5d442 0 0) 9% 8px / 4px 4px no-repeat,
    linear-gradient(#f2f2f2 0 0) 37% 8px / 4px 4px no-repeat,
    linear-gradient(#e86a8a 0 0) 71% 8px / 4px 4px no-repeat,
    linear-gradient(#f5d442 0 0) 88% 8px / 4px 4px no-repeat,
    linear-gradient(#9a9a92 0 0) 18% 36px / 8px 4px no-repeat,
    linear-gradient(#8a8a82 0 0) 54% 60px / 4px 4px no-repeat,
    linear-gradient(#9a9a92 0 0) 79% 44px / 8px 4px no-repeat,
    linear-gradient(#86c45c 0 8px, #5d9c3f 8px 16px, #4c8434 16px 20px, transparent 20px),
    conic-gradient(#6e4a2b 25%, transparent 0 50%, #6e4a2b 0 75%, transparent 0) 0 20px / 24px 24px,
    conic-gradient(#86603a 25%, transparent 0 50%, #86603a 0 75%, transparent 0) 8px 28px / 40px 40px,
    #7a5230;
  -webkit-mask:
    linear-gradient(90deg, #000 0 4px, transparent 0) 0 0 / 20px 4px repeat-x,
    linear-gradient(90deg, transparent 0 8px, #000 0 16px, transparent 0) 0 4px / 28px 4px repeat-x,
    linear-gradient(90deg, #000 0 50%, transparent 0) 4px 4px / 12px 4px repeat-x,
    linear-gradient(#000, #000) 0 8px / 100% 100% no-repeat;
          mask:
    linear-gradient(90deg, #000 0 4px, transparent 0) 0 0 / 20px 4px repeat-x,
    linear-gradient(90deg, transparent 0 8px, #000 0 16px, transparent 0) 0 4px / 28px 4px repeat-x,
    linear-gradient(90deg, #000 0 50%, transparent 0) 4px 4px / 12px 4px repeat-x,
    linear-gradient(#000, #000) 0 8px / 100% 100% no-repeat;
  image-rendering: pixelated;
}

/* 6. The daily ideas counter is a grown-up thing. */
html:not([data-who="graham"]):not([data-who="kate"]) .quota-bar { display: none !important; }

/* 7. Not sent to the shop yet: a calm amber strip that stays until the shop has every idea
      and picture. Intrinsic layout (no breakpoints): flex-wrap puts Try again beside the words
      when there is room and on its own line, still right-aligned, when there is not. The strip
      never changes height: both messages share one grid cell, and both button labels share one. */
.dd-shop-alert {
  --_tone: #F5BC4C;
  --_ink: var(--dd-ink);
  /* v37: in the page flow under the top bar; it never floats over content. */
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3, 12px) var(--space-4, 16px);
  width: min(100% - 2 * var(--dd-pad), var(--measure-wide, 1040px));
  margin: var(--space-4, 16px) auto 0;
  padding: var(--space-4, 16px) var(--space-5, 24px);
  border-radius: 4px;
  background: color-mix(in srgb, var(--_tone) 14%, var(--dd-surface));
  border: 2px solid color-mix(in srgb, var(--_tone) 70%, transparent);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--_tone) 35%, #000);
  color: var(--_ink);
  transition: opacity .3s ease, transform .3s ease;
}
.dd-shop-alert[hidden] { display: none; }
.dd-shop-alert.is-leaving { opacity: 0; transform: translateY(-16px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .dd-shop-alert { transition: none; }
  .dd-shop-alert.is-leaving { transform: none; }
}
.dd-shop-ico { width: 32px; height: 32px; flex-shrink: 0; image-rendering: pixelated; }
.dd-shop-text { flex: 1 1 20rem; min-width: 0; }
.dd-shop-title {
  margin: 0;
  font-family: var(--dd-px);
  font-size: clamp(12px, 1rem + .2vw, 15px);
  line-height: 1.5;
  color: var(--_tone);
}
.dd-shop-msgs { display: grid; margin-top: var(--space-1, 4px); }
.dd-shop-body, .dd-shop-still { grid-area: 1 / 1; margin: 0; font: 500 17px/1.4 var(--dd-body); }
.dd-shop-still { color: var(--_tone); visibility: hidden; }
.dd-shop-alert.is-still .dd-shop-body { visibility: hidden; }
.dd-shop-alert.is-still .dd-shop-still { visibility: visible; }

/* Try again: amber outline, so Build a game stays the only green hero. */
.dd-shop-retry {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  margin-inline-start: auto;
  min-height: 56px;
  min-width: 10rem;
  padding: 0 var(--space-5, 24px);
  border: 2px solid var(--_tone);
  border-radius: 4px;
  background: transparent;
  color: var(--_tone);
  font: 400 clamp(12px, .9rem + .2vw, 14px)/1.4 var(--dd-px);
  cursor: pointer;
  transition: background-color .12s ease, transform .12s ease;
}
.dd-shop-retry > span { grid-area: 1 / 1; }
.dd-shop-retry .dd-lbl-busy, .dd-shop-retry.is-busy .dd-lbl-try { visibility: hidden; }
.dd-shop-retry.is-busy .dd-lbl-busy { visibility: visible; }
.dd-shop-retry:hover { background: color-mix(in srgb, var(--_tone) 12%, transparent); }
.dd-shop-retry:active { transform: translateY(2px); }
.dd-shop-retry:focus-visible { outline: 3px solid var(--dd-blue); outline-offset: 3px; }
.dd-shop-retry:disabled { cursor: progress; opacity: .8; transform: none; }

/* Per-idea badge on My games rows: it takes the row's one status slot (where Open /
   Dave is building would be), so the row keeps its height. */
.dd-unsent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, #F5BC4C 16%, transparent);
  color: #F5BC4C;
  font: 600 13px/1.2 var(--dd-body);
  white-space: nowrap;
}
.dd-unsent::before {
  content: "";
  inline-size: 8px;
  block-size: 8px;
  background: currentColor;
}

/* ---------- v36: simple kid flow + "Piper has a question" ---------- */
/* Kid screens skip the grown-up release notes (Go!, Send to Store). */
html:not([data-who="graham"]):not([data-who="kate"]) #whats-new-more > p:not(#whats-new-commit) { display: none; }

/* Piper's question has its own colour: purple, so it never reads as the amber "Not sent"
   strip, the amber "Dave's building it", or the blue focus ring. */
:root { --dd-purple: #b48cff; --dd-purple-ink: #1a1030; }
html[data-who="kate"] { --dd-purple: #6b46c1; --dd-purple-ink: #ffffff; }

.dd-q-dot {
  display: inline-block;
  inline-size: 10px;
  block-size: 10px;
  margin-inline-end: 8px;
  background: var(--dd-purple);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--dd-purple) 35%, transparent);
  vertical-align: middle;
  flex-shrink: 0;
}
.dd-q-dot[hidden] { display: none; }
#tab-talk .dd-q-dot { margin: 0 0 0 8px; }

.dd-q-badge {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--dd-purple);
  color: var(--dd-purple-ink);
  font: 700 12px/1.2 var(--dd-body);
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}
.dd-q-badge[hidden] { display: none; }

/* Row status slot. */
.dd-row-state.dd-row-ask { color: var(--dd-purple); font-weight: 600; white-space: nowrap; }
/* v37: the purple bar sits outside the text column so it never clips the first letter. */
.dd-row.has-question { position: relative; box-shadow: none; }
.dd-row.has-question::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--dd-purple);
}

/* The open-Daydream banner: same shape as the shop strip, purple, one line. */
.dd-piper-alert {
  --_tone: var(--dd-purple);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3, 12px) var(--space-4, 16px);
  width: min(100% - 2 * var(--dd-pad), var(--measure-wide, 1040px));
  margin: var(--space-4, 16px) auto 0;
  padding: var(--space-3, 12px) var(--space-5, 24px);
  border-radius: 4px;
  background: color-mix(in srgb, var(--_tone) 14%, var(--dd-surface));
  border: 2px solid color-mix(in srgb, var(--_tone) 70%, transparent);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--_tone) 35%, #000);
  color: var(--dd-ink);
}
.dd-piper-alert[hidden] { display: none; }
.dd-piper-text { flex: 1 1 16rem; min-width: 0; color: var(--dd-ink); font: 600 18px/1.4 var(--dd-body); text-decoration: none; }
.dd-piper-go {
  display: inline-grid;
  place-items: center;
  min-height: 52px;
  min-width: 8rem;
  margin-inline-start: auto;
  padding: 0 var(--space-5, 24px);
  border-radius: 4px;
  /* v37: outline only. Build a game stays the one filled hero. */
  background: transparent;
  border: 2px solid var(--_tone);
  color: var(--_tone);
  font: 400 clamp(12px, .9rem + .2vw, 14px)/1.4 var(--dd-px);
  text-decoration: none;
}
.dd-piper-go:hover { background: color-mix(in srgb, var(--_tone) 14%, transparent); }
.dd-piper-x {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--dd-ink-3, #9aa0a6);
  font-size: 24px;
  cursor: pointer;
}
.dd-piper-go:focus-visible, .dd-piper-x:focus-visible, .dd-piper-text:focus-visible { outline: 3px solid var(--dd-blue); outline-offset: 3px; }

/* Game page: chip, banner and the question cards in Talk. */
.status-chip.is-ask { background: var(--dd-purple) !important; color: var(--dd-purple-ink) !important; border-color: var(--dd-purple) !important; }
.ready-banner.is-ask { background: color-mix(in srgb, var(--dd-purple) 22%, #14101f) !important; border-color: var(--dd-purple) !important; }
.ready-banner.is-ask strong { color: var(--dd-purple) !important; }
html[data-who="kate"] .ready-banner.is-ask { background: #f1ebff !important; }
.ready-banner.is-ask .ready-proto-link { background: var(--dd-purple); color: var(--dd-purple-ink); }

.piper-asks { display: grid; gap: 12px; margin: 12px 0 16px; }
.piper-asks[hidden] { display: none; }
.piper-ask {
  padding: 14px 16px;
  border: 2px solid var(--dd-purple);
  border-radius: 4px;
  /* Its own dark card so the purple, amber and green read on the tan wood panel too. */
  background: #1d1530;
  color: #f3eeff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.piper-ask.is-answered { border-style: dashed; }
.piper-ask-from { display: flex; align-items: center; color: #c9b2ff; font: 400 11px/1.6 var(--dd-px); }
.piper-ask-q { margin: 8px 0 12px; color: #fff; font: 600 19px/1.4 var(--dd-body); }
.piper-ask-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.piper-choice {
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid #b48cff;
  border-radius: 4px;
  background: #2b2045;
  color: #fff;
  font: 600 16px/1.2 var(--dd-body);
  cursor: pointer;
}
.piper-choice:hover { background: #3a2b5e; }
.piper-choice:focus-visible { outline: 3px solid var(--dd-blue); outline-offset: 3px; }
.piper-ask-text { width: 100%; box-sizing: border-box; }
.piper-ask-send { margin-top: 8px; }
.piper-ask-a { margin: 0; color: #fff; font: 500 17px/1.4 var(--dd-body); }
.piper-ask-you { display: block; color: #c9b2ff; font: 600 13px/1.4 var(--dd-body); }
.piper-ask .piper-ask-from, .piper-ask .piper-ask-you { text-shadow: none; }
.piper-ask-unsent { margin: 8px 0 0; color: #F5BC4C; font: 600 14px/1.3 var(--dd-body); }
.piper-ask-thanks { margin: 8px 0 0; color: #8fd88f; font: 600 14px/1.3 var(--dd-body); }
.piper-ask .field-label { color: #c9b2ff; }

/* ---- v37 ---- */
/* Every row has the same ··· menu, so no empty slot is needed. */
.dd-pop .card-open { font-weight: 700; }

/* Passkey lives in Settings (the name menu), not in Talk. */
.who-settings { display: grid; gap: 6px; min-width: 260px; padding: 8px 12px 4px; border-top: 1px solid var(--dd-line); }
.who-settings-head { margin: 0; color: var(--dd-ink-3); font: 600 12px/1.3 var(--dd-body); }
.who-settings .piper-auth { display: grid; gap: 6px; }
.who-settings .piper-auth .chunk-input { width: 100%; min-height: 40px; font-size: 15px; }
.who-settings .piper-auth .btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.who-settings .piper-auth button { border: 1px solid var(--dd-edge); }

/* Step strip: Idea, Building, Play. Same three chips on every game. */
.dd-steps { display: grid; gap: 6px; margin: 4px 0 12px; }
.dd-step-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dd-step-chip {
  padding: 6px 12px;
  border: 2px solid var(--dd-edge);
  border-radius: 0;
  background: transparent;
  color: var(--dd-ink-3);
  font: 400 11px/1.4 var(--dd-px);
  letter-spacing: 1px;
}
.dd-step-chip.is-on { background: var(--dd-green); border-color: var(--dd-green); color: var(--dd-green-ink); }
.dd-steps[data-step="paused"] .dd-step-chip.is-on { background: var(--dd-amber); border-color: var(--dd-amber); }
.dd-step-hint { margin: 0; color: var(--dd-ink-2); font: 500 15px/1.4 var(--dd-body); }
.dd-step-hint[hidden] { display: none; }

/* Bottom button follows the step. Building and Paused say what's happening; nothing to tap, no stripes. */
#go-btn { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
#go-btn.is-wait, #go-btn.is-paused {
  cursor: default;
  filter: none;
  transform: none;
  animation: none;
  background: #2a2f36;
  border-color: #3a4048;
  color: var(--dd-ink-2);
  text-shadow: none;
  box-shadow: 0 6px 0 #000;
  font-size: 18px;
  letter-spacing: 1px;
}
#go-btn.is-paused { background: #3a2f1a; border-color: #6b5326; color: #f5d79a; }
#go-btn.is-wait:disabled, #go-btn.is-paused:disabled { opacity: 1; }
#go-btn.is-play { min-height: 88px; font-size: 30px; }
#go-btn .go-play { font-size: .9em; margin-inline-end: 12px; }

/* The sticky button never covers the last field: room for the bar plus the iPad home bar. */
:root { --dd-cta-h: 104px; }
#view-project { padding-bottom: calc(var(--dd-cta-h) + env(safe-area-inset-bottom, 0px)); }
html { scroll-padding-bottom: calc(var(--dd-cta-h) + env(safe-area-inset-bottom, 0px)); }

/* Sign-off cards kept on a building or playable game (content only) sit tight. */
.signoff-box.is-compact { padding-block: 12px; }

/* ---- v38 ---- */
/* Step strip reads as status, not tabs: small pixel labels on a thin line. Only the current step is filled. */
.dd-steps { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 4px; margin: 4px 0 16px; }
.dd-step-chips { display: flex; align-items: center; gap: 0; min-height: 28px; flex-wrap: nowrap; pointer-events: none; user-select: none; -webkit-user-select: none; }
.dd-step-chip {
  display: flex; align-items: center;
  padding: 0; border: 0; background: none; box-shadow: none;
  color: var(--dd-ink-3);
  font: 400 10px/1 var(--dd-px); letter-spacing: 1px;
  cursor: default;
}
.dd-step-chip + .dd-step-chip::before {
  content: ""; display: block; width: 22px; height: 0;
  border-top: 2px dotted var(--dd-edge);
  margin: 0 8px;
}
.dd-step-label { display: inline-flex; align-items: center; height: 28px; padding: 0 2px; }
.dd-step-chip.is-on { background: none; border: 0; color: var(--dd-green-ink); }
.dd-step-chip.is-on .dd-step-label { background: var(--dd-green); padding: 0 10px; }
.dd-steps[data-step="paused"] .dd-step-chip.is-on { background: none; }
.dd-steps[data-step="paused"] .dd-step-chip.is-on .dd-step-label { background: var(--dd-amber); color: #1f1606; }
.dd-steps .dd-step-hint { font-size: 14px; }

/* Paused game: muted amber chip, no green. */
.status-chip.is-paused,
html[data-who] .status-chip.is-paused {
  background: #3a2f1a !important; color: #f0cf8e !important; border-color: #6b5326 !important; box-shadow: none !important;
}

/* Play: Talk is a quiet text link. */
.signoff-box.is-quiet-talk #concept-talk-row { display: block; margin-top: 4px; }
.signoff-box.is-quiet-talk #concept-talk {
  all: unset; cursor: pointer;
  color: inherit; font: 600 15px/1.4 var(--dd-body);
  text-decoration: underline; text-underline-offset: 3px;
}
.signoff-box.is-quiet-talk #concept-talk:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Play: the story outline folds to one tappable line. */
.story-toggle {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font: 400 12px/1.4 var(--dd-px); letter-spacing: 1px; color: inherit; min-height: 44px;
}
.story-toggle[hidden] { display: none; }
.story-toggle .story-caret { display: inline-block; font-size: 16px; transition: transform .15s; }
.signoff-box.is-open .story-toggle .story-caret { transform: rotate(90deg); }
.signoff-box.is-folded > :not(.signoff-head) { display: none !important; }
.signoff-box.is-folded { padding-block: 6px; }

/* Toast sits 12px above the bottom button (placed by JS); keep it above the bar. */
.toast { z-index: 60; }

/* Talk: pointer to Settings only with no passkey session. */
.piper-status.is-pointer { font-weight: 600; }
#piper-send:disabled { opacity: .5; cursor: not-allowed; }
