body {
  background: #fbf6eb;
  color: #24413e;
}
#discovery-header {
  background: white;
  border-bottom: 1px solid #e3e6dc;
}
.discovery-top {
  max-width: 1150px;
  margin: auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.discovery-top a {
  text-decoration: none;
  color: inherit;
}
.discovery-top strong {
  font: 26px var(--display, sans-serif);
}
.d-wrap {
  max-width: 1040px;
  margin: auto;
  padding: 28px 22px 65px;
}
.d-intro {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  gap: 30px;
  padding: 25px 0;
}
.d-intro h1 {
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.05;
}
.d-intro svg {
  max-height: 260px;
}
.d-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.d-tabs a {
  padding: 12px 18px;
  border-radius: 30px;
  background: white;
  text-decoration: none;
  color: #24413e;
  border: 2px solid transparent;
}
.d-tabs .selected {
  border-color: #23685c;
}
.d-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.d-unit {
  background: white;
  border-radius: 22px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d9dfd2;
  box-shadow: 0 5px 0 #e9e4d9;
}
.d-unit svg {
  width: 100%;
  height: 128px;
}
.d-unit h3 {
  font-size: 20px;
  margin: 12px 0 6px;
}
.d-unit small {
  display: block;
  color: #677a72;
}
.d-stage {
  max-width: 850px;
  margin: auto;
  background: white;
  border-radius: 28px;
  padding: 26px;
  border: 1px solid #d9dfd2;
}
.d-stage h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 12px 0;
}
.d-stage > p {
  font-size: 19px;
}
.d-step {
  display: flex;
  gap: 12px;
  color: #65766e;
  font-size: 14px;
}
.d-step b {
  color: #23685c;
}
.d-scene {
  display: block;
  width: 100%;
  max-height: 290px;
  margin: 18px auto;
}
.d-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}
.d-pair svg {
  width: 100%;
  max-height: 240px;
}
.d-pair h3 {
  text-align: center;
}
.d-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 25px 0;
}
.d-choice {
  border: 3px solid #e5e7dc;
  background: #fbf6eb;
  border-radius: 22px;
  min-height: 115px;
  padding: 14px;
  cursor: pointer;
  color: #24413e;
  font: 600 56px sans-serif;
}
.d-choice svg {
  width: 100%;
  max-height: 210px;
  display: block;
}
.d-choice:hover,
.d-choice:focus-visible {
  border-color: #23685c;
}
.d-choice[disabled] {
  opacity: 0.65;
  cursor: default;
}
.d-choice.correct {
  border-color: #529b74;
}
.d-count {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 24px 0;
}
.d-count button {
  border: 2px solid #e5e7dc;
  background: #fbf6eb;
  border-radius: 14px;
  min-height: 90px;
  cursor: pointer;
}
.d-count svg {
  width: 100%;
}
.d-count .counted {
  background: #d9ecdf;
  border-color: #529b74;
}
.d-count span {
  display: block;
  font-size: 18px;
  font-weight: bold;
}
.d-feedback {
  min-height: 50px;
  font-size: 20px;
  color: #23685c;
  margin: 15px 0;
}
.d-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 22px 0;
}
.d-actions button,
.d-actions a {
  min-height: 48px;
}
.d-paint {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  max-width: 380px;
  margin: 24px auto;
  background: #e8eee4;
  padding: 14px;
  border-radius: 18px;
}
.d-paint button {
  aspect-ratio: 1;
  border: 2px solid #71817b;
  border-radius: 12px;
  cursor: pointer;
}
.d-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
}
.d-palette button {
  width: 49px;
  height: 49px;
  border: 3px solid #adb7ab;
  border-radius: 50%;
  cursor: pointer;
}
.d-palette button[aria-pressed="true"] {
  outline: 3px solid #24413e;
  outline-offset: 3px;
}
.d-note {
  padding: 18px 22px;
  background: #edf3e9;
  border-radius: 16px;
  margin: 20px 0;
  line-height: 1.7;
}
.d-counter {
  font-size: 27px;
  text-align: center;
}
.d-swatch {
  width: 82px;
  height: 82px;
  display: block;
  border: 2px solid #71817b;
  border-radius: 50%;
  margin: auto;
}
.d-trace {
  width: 100%;
  height: 230px;
  touch-action: none;
  background: #fbf6eb;
  border: 2px dashed #b3c4b3;
  border-radius: 18px;
}
.d-trace-example {
  font-size: 72px;
  color: #a4b9a3;
  text-align: center;
}
.d-badge {
  font-size: 70px;
  text-align: center;
}
.d-small {
  font-size: 14px;
  color: #68786f;
}
#discovery-status {
  position: fixed;
  bottom: 15px;
  left: 20px;
  right: 20px;
  text-align: center;
  background: #24413e;
  color: white;
  border-radius: 12px;
  padding: 10px;
  display: none;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #d77658;
  outline-offset: 3px;
}
.d-stage .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.d-pair.speed svg {
  animation: little-roll 3s linear infinite alternate;
}
.d-pair.speed > :last-child svg {
  animation-duration: 8s;
}
@keyframes little-roll {
  from {
    transform: translateX(-5px);
  }
  to {
    transform: translateX(5px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .d-pair.speed svg {
    animation: none;
  }
}
@media (max-width: 650px) {
  .d-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .d-intro {
    grid-template-columns: 1fr;
  }
  .d-intro svg {
    display: none;
  }
  .d-stage {
    padding: 18px;
  }
  .d-wrap {
    padding: 20px 12px 50px;
  }
  .d-choices {
    gap: 8px;
  }
  .d-choice {
    font-size: 42px;
    padding: 7px;
    min-height: 95px;
  }
  .d-count {
    grid-template-columns: repeat(3, 1fr);
  }
  .d-pair {
    gap: 8px;
  }
  .d-step {
    font-size: 12px;
    gap: 8px;
  }
}
@media print {
  #discovery-header,
  .d-actions,
  .d-palette,
  .d-step,
  #discovery-status,
  .d-small {
    display: none !important;
  }
  body,
  .d-stage {
    background: white;
    border: 0;
  }
  .d-wrap {
    padding: 0;
  }
  .d-stage {
    break-inside: avoid;
  }
  .d-paint button {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .d-note {
    border: 1px solid #ddd;
  }
  button {
    color: black;
  }
}

.d-listen-picture {
  display: block;
  padding: 12px;
  border: 2px solid #d9dfd2;
  border-radius: 20px;
  background: #fbf6eb;
  color: #24413e;
  cursor: pointer;
}
.d-listen-picture span {
  font-size: 16px;
}
.d-single-picture {
  width: min(100%, 400px);
  margin: 20px auto;
}
.d-choice.correct[disabled] {
  opacity: 1;
  box-shadow: 0 0 0 2px #529b74;
}
.d-small {
  overflow-wrap: anywhere;
}
@media print {
  .d-paint > * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
.discovery-top .actions { display: flex; gap: 10px; align-items: center; }
.discovery-top .quiet { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.d-locked { text-align: center; background: #fffdf8; border: 1px solid #eadfcd; border-radius: 26px; padding: 28px 22px; max-width: 560px; margin: 10px auto; }
.d-locked svg { max-width: 260px; margin: 8px auto; display: block; opacity: 0.85; }
.d-locked .d-actions { justify-content: center; }
.d-unit.is-locked { opacity: 0.7; }

/* Let's think together: after a wrong answer, compare the choice with the goal. */
.d-think {
  border: 2px dashed #e0b45c;
  background: #fff8e8;
  border-radius: 22px;
  padding: 14px 16px;
  margin: 14px 0;
}
.d-think-title {
  font-weight: 800;
  color: #8a5a12;
  margin-bottom: 8px;
}
.d-think-note {
  margin: 10px 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
}
.d-rows {
  display: grid;
  gap: 10px;
}
.d-row {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  align-items: center;
  gap: 8px;
}
.d-row-label {
  font-size: 0.95rem;
}
.d-row-label b {
  font-size: 1.6rem;
  color: #23685c;
}
.d-row.mine .d-row-label b {
  color: #b5562f;
}
.d-slots {
  display: grid;
  grid-template-columns: repeat(min(var(--slots), 5), minmax(0, 1fr));
  gap: 6px;
}
.d-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2px solid #e5e7dc;
  background: #fff;
  padding: 3px;
  display: grid;
  place-items: center;
  font: inherit;
}
.d-slot svg {
  width: 100%;
  height: 100%;
  opacity: 0.45;
}
.d-slot.lit svg {
  opacity: 1;
}
.d-slot b {
  position: absolute;
  bottom: 2px;
  inset-inline-end: 6px;
  font-size: 0.85rem;
  color: #23685c;
}
.d-slot.empty {
  border-style: dashed;
  background: transparent;
}
button.d-slot {
  cursor: pointer;
  border-color: #23685c;
  animation: d-pulse 1.6s ease-in-out infinite;
}
.d-slot.extra {
  border-color: #d77658;
  background: #fde9e1;
}
@keyframes d-pulse {
  50% {
    transform: scale(1.04);
  }
}
@media (prefers-reduced-motion: reduce) {
  button.d-slot {
    animation: none;
  }
}
.d-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.d-card {
  background: #fff;
  border: 2px solid #e5e7dc;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
}
.d-card.mine {
  border-color: #e7b9a6;
}
.d-card.goal {
  border-color: #9cc7b0;
}
.d-card p {
  margin: 6px 0 0;
  font-size: 0.95rem;
}
.d-mini {
  width: 100%;
  max-height: 110px;
}
.d-card .d-swatch {
  display: block;
  margin: 6px auto;
  width: 64px;
  height: 64px;
}
.d-goal-q {
  font-size: 3rem;
  font-weight: 800;
  color: #23685c;
  line-height: 1.4;
}
.d-choice.tried {
  opacity: 0.45;
  border-style: dashed;
  position: relative;
}
.d-tried-label {
  display: block;
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Map: clear status per activity. */
.d-unit {
  position: relative;
}
.d-unit.is-done {
  border-color: #529b74;
  background: #f0f8f2;
}
.d-unit.is-done small b {
  color: #2f7a52;
}
.d-unit.is-next {
  border-color: #d77658;
  box-shadow: 0 0 0 3px #f6d5c8;
}
.d-unit.is-started small {
  color: #8a5a12;
}
.d-badge-done {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #529b74;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  z-index: 1;
}
.d-tabs small {
  opacity: 0.7;
  font-size: 0.8em;
}
/* Number activities: exactly n squares, numbered as they are coloured. */
.d-make-goal {
  font-size: 1.4rem;
  margin: 6px 0;
}
.d-make-goal b {
  font-size: 2.2rem;
  color: #23685c;
  margin-inline-end: 8px;
}
.d-paint.d-paint-n {
  grid-template-columns: repeat(5, minmax(0, 72px));
  justify-content: start;
}
.d-paint button b {
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Meet it (I do): the symbol is taught before any question. */
.d-meet {
  margin: 16px 0 6px;
  padding: 16px;
  border-radius: 22px;
  background: #e4f1ea;
  text-align: center;
}
.d-meet-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 4px 0 10px;
}
.d-meet-note {
  margin: 8px 0 0;
  color: #3b5a52;
}
.d-meet-symbol {
  font-family: inherit;
  font-weight: 800;
  font-size: 5.5rem;
  line-height: 1;
  width: 140px;
  height: 140px;
  border-radius: 32px;
  border: 4px solid #23685c;
  background: #fff;
  color: #23685c;
  cursor: pointer;
  animation: d-pulse 1.6s ease-in-out infinite;
}
.d-meet-symbol.met,
.d-single-picture.met {
  animation: none;
  border-color: #529b74;
}
.d-meet .d-single-picture:not(.met) {
  animation: d-pulse 1.6s ease-in-out infinite;
}
.d-big-swatch {
  display: block;
  width: 90px;
  height: 90px;
  margin: 0 auto 8px;
  border-radius: 50%;
}
/* Guided first question: a small reminder of what was just learned. */
.d-reminder {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin: 4px 0 12px;
  border-radius: 99px;
  background: #fff8e8;
  border: 2px dashed #e0b45c;
  font-weight: 700;
}
.d-reminder small {
  color: #8a5a12;
  font-weight: 700;
}
.d-reminder b {
  font-size: 1.8rem;
  color: #23685c;
}
.d-reminder .d-mini {
  width: 48px;
  height: 36px;
}
.d-reminder .d-swatch {
  width: 30px;
  height: 30px;
}
/* A gentle nudge when a child hesitates: the right answer glows. */
.d-choice.hint {
  border-color: #e0b45c;
  box-shadow: 0 0 0 6px rgba(224, 180, 92, 0.35);
  animation: d-pulse 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .d-meet-symbol,
  .d-meet .d-single-picture:not(.met),
  .d-choice.hint {
    animation: none;
  }
}
