:root {
  --ink: #17372f;
  --ink-soft: #31584d;
  --cream: #fffdf0;
  --paper: #fffaf0;
  --grass: #4c844a;
  --grass-dark: #275937;
  --soil: #74452f;
  --sun: #f5c842;
  --blue: #2b7591;
  --red: #ad3f57;
  --focus: #172ac2;
  --shadow: 0 12px 0 rgba(78, 69, 39, .16), 0 22px 44px rgba(62, 74, 51, .14);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  color: var(--ink);
  background: #e5f0cf;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: linear-gradient(#d7ecdf 0 64%, #8bb65e 64%); }
button { font: inherit; color: inherit; }
button, [role="button"] { touch-action: manipulation; }
button:focus-visible, [tabindex]:focus-visible, dialog:focus-visible { outline: 5px solid var(--focus); outline-offset: 5px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 12px; top: 10px; z-index: 100; padding: 12px 18px; border-radius: 12px; background: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.topbar { position: sticky; top: 0; z-index: 30; min-height: 86px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px clamp(10px, 3vw, 34px); border-bottom: 4px solid rgba(39,89,55,.2); background: rgba(255,253,240,.96); backdrop-filter: blur(8px); }
.control-cluster { display: flex; gap: 8px; }
.round-control { min-width: 68px; min-height: 64px; display: grid; place-items: center; gap: 1px; padding: 6px 10px; border: 3px solid #31584d; border-radius: 18px; background: #fffdf0; box-shadow: 0 4px 0 #31584d; cursor: pointer; }
.round-control:hover { transform: translateY(-2px); }
.round-control:active { transform: translateY(2px); box-shadow: 0 1px 0 #31584d; }
.round-control svg { width: 30px; height: 30px; fill: #31584d; stroke: #31584d; stroke-width: 5px; }
.round-control span { font-size: 13px; font-weight: 800; }
.mute-slash { display: none; fill: none; stroke: var(--red); stroke-width: 6; }
#muteButton[aria-pressed="true"] .mute-slash { display: block; }
.garden-progress { justify-self: center; display: flex; align-items: end; gap: clamp(8px, 2vw, 20px); height: 58px; }
.progress-seed { position: relative; display: block; width: 28px; height: 20px; border: 3px solid var(--grass-dark); border-radius: 50%; background: #c89458; }
.progress-seed.is-done { width: 42px; height: 42px; border-radius: 50% 50% 48% 52%; background: var(--sun); transform: translateY(-5px); box-shadow: inset 0 0 0 8px #fff0a8; }
.progress-seed.is-done::before { content: ""; position: absolute; width: 6px; height: 28px; background: var(--grass-dark); left: 15px; top: 34px; z-index: -1; }

main { min-height: calc(100vh - 86px); }
.screen { min-height: calc(100vh - 86px); width: 100%; padding: clamp(22px, 5vw, 60px) clamp(16px, 5vw, 72px); }
.welcome-screen { position: relative; min-height: 100vh; display: grid; place-items: center; isolation: isolate; }
.welcome-art { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
.sun { position: absolute; width: clamp(120px, 18vw, 220px); aspect-ratio: 1; left: 8%; top: 8%; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 22px rgba(245,200,66,.24), 0 0 0 46px rgba(245,200,66,.12); }
.cloud { position: absolute; width: 160px; height: 45px; border-radius: 50px; background: rgba(255,255,255,.85); }
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 70px; height: 70px; left: 25px; bottom: 0; }
.cloud::after { width: 90px; height: 90px; right: 15px; bottom: 0; }
.cloud-one { right: 8%; top: 15%; }
.cloud-two { left: 22%; top: 34%; transform: scale(.7); }
.hill { position: absolute; left: -10%; width: 120%; height: 45%; bottom: -20%; border-radius: 50% 50% 0 0; }
.hill-back { background: #78a959; bottom: -12%; transform: rotate(3deg); }
.hill-front { background: #4c844a; transform: rotate(-4deg); }
.garden-sign { position: absolute; left: 50%; top: 45%; width: 230px; height: 110px; transform: translateX(-50%) rotate(-2deg); border: 8px solid #633d28; border-radius: 18px; background: #ffe4a6; box-shadow: 0 14px 0 #593622; display: flex; align-items: center; justify-content: center; gap: 18px; }
.garden-sign::after { content: ""; position: absolute; width: 24px; height: 180px; top: 95px; background: #633d28; z-index: -1; }
.sign-shape { display: block; width: 48px; height: 48px; border: 5px solid #17372f; }
.sign-circle { border-radius: 50%; background: var(--sun); }
.sign-square { background: var(--blue); }
.sign-triangle { width: 0; height: 0; border: 27px solid transparent; border-bottom: 48px solid var(--red); border-top: 0; }
.flower-row { position: absolute; inset: auto 0 5% 0; display: flex; justify-content: space-around; }
.flower-row i { width: 50px; height: 50px; border-radius: 50%; background: #fff0a8; box-shadow: 0 -30px 0 #fff0a8, 0 30px 0 #fff0a8, -30px 0 0 #fff0a8, 30px 0 0 #fff0a8; }

.welcome-card { width: min(610px, 92vw); margin-top: -12vh; padding: clamp(24px, 5vw, 54px); text-align: center; border: 5px solid var(--ink); border-radius: 38px 38px 28px 28px; background: rgba(255,253,240,.96); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 10px; color: #436052; font-size: clamp(.78rem, 2vw, .95rem); font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; line-height: .98; letter-spacing: -.035em; }
h1 { font-size: clamp(3rem, 9vw, 6rem); }
h2 { font-size: clamp(2.3rem, 6vw, 4.6rem); }
.welcome-copy { max-width: 35ch; margin: 22px auto; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.45; }
.primary-action, .finish-button { min-height: 72px; min-width: min(100%, 290px); padding: 16px 26px; border: 4px solid var(--grass-dark); border-radius: 22px; background: var(--sun); box-shadow: 0 7px 0 var(--grass-dark); font-size: 1.25rem; font-weight: 900; cursor: pointer; }
.primary-action:hover, .finish-button:hover { transform: translateY(-2px); }
.primary-action:active, .finish-button:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--grass-dark); }
.button-sprout { display: inline-block; width: 24px; height: 28px; margin-right: 9px; vertical-align: middle; border-left: 5px solid var(--grass-dark); }
.button-sprout::before, .button-sprout::after { content: ""; display: block; width: 15px; height: 11px; border-radius: 100% 0 100% 0; background: var(--grass); }
.button-sprout::before { transform: translate(-15px, 2px) rotate(12deg); }
.button-sprout::after { transform: translate(0, -2px) scaleX(-1) rotate(12deg); }
.text-action { min-height: 64px; padding: 14px 22px; border: 0; background: transparent; color: #244c40; text-decoration: underline; text-underline-offset: 5px; font-weight: 900; cursor: pointer; }
.privacy-note { margin: 8px 0 0; font-size: .85rem; line-height: 1.4; color: #52685e; }

.map-screen { background: radial-gradient(circle at 50% 0, #fffdf0 0 28%, transparent 29%), #f3edcc; }
.map-copy { text-align: center; max-width: 760px; margin: 0 auto 34px; }
.map-copy p:last-child { font-size: 1.1rem; }
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 34px); max-width: 1150px; margin: 0 auto; }
.path-card { position: relative; min-height: 365px; padding: 26px 18px 24px; border: 5px solid var(--ink); border-radius: 110px 110px 30px 30px; background: var(--paper); box-shadow: var(--shadow); cursor: pointer; overflow: hidden; }
.path-card::after { content: ""; position: absolute; inset: auto -15% -10% -15%; height: 35%; border-radius: 50% 50% 0 0; background: #9db871; z-index: 0; }
.path-card > * { position: relative; z-index: 1; }
.path-card:hover { transform: rotate(-1deg) translateY(-6px); }
.path-card:nth-child(2):hover { transform: rotate(1deg) translateY(-6px); }
.path-card strong { display: block; margin-top: 20px; font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.path-card small { display: block; margin-top: 7px; font-size: 1rem; }
.path-number { position: absolute; left: 22px; top: 22px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-weight: 900; }
.path-illustration { height: 145px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.match-illustration i { width: 86px; height: 86px; border: 11px solid var(--blue); border-radius: 50%; }
.match-illustration i:last-child { width: 60px; height: 60px; border-color: var(--sun); }
.sort-illustration i { width: 92px; height: 72px; border: 8px solid var(--soil); border-top: 0; border-radius: 0 0 28px 28px; background: repeating-linear-gradient(45deg,#f5c842 0 10px,#fff0a8 10px 20px); }
.sort-illustration i:last-child { background: repeating-linear-gradient(0deg,#2b7591 0 10px,#b9e4ee 10px 20px); }
.count-illustration i { width: 52px; height: 52px; border-radius: 50%; background: var(--red); border: 6px solid #fff0a8; }
.count-illustration i:nth-child(2) { transform: translateY(-25px); }
.completion-flower { display: none; position: absolute; width: 42px; height: 42px; right: 24px; bottom: 26px; border-radius: 50%; background: #fff0a8; box-shadow: 0 -20px 0 #fff0a8, 0 20px 0 #fff0a8, -20px 0 0 #fff0a8, 20px 0 0 #fff0a8; }
.path-card.is-done .completion-flower { display: block; }
.finish-button { display: block; margin: 42px auto 0; }

.activity-screen { background: linear-gradient(180deg, #fffdf0 0 74%, #d4d89d 74%); }
.activity-heading { max-width: 880px; margin: 0 auto 24px; text-align: center; }
.activity-kicker { margin: 0 0 8px; color: #52685e; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.spoken-prompt { min-height: 38px; max-width: 52ch; margin: 18px auto 0; font-size: clamp(1.1rem, 2.3vw, 1.4rem); line-height: 1.4; font-weight: 800; }
#activityStage { max-width: 1040px; margin: 0 auto; }
.feedback { min-height: 68px; max-width: 720px; margin: 22px auto 0; padding: 12px 18px; display: grid; place-items: center; text-align: center; border-radius: 18px; font-size: 1.15rem; font-weight: 900; }
.feedback.is-hint { border: 3px dashed #936730; background: #fff1c5; }
.feedback.is-success { border: 3px solid #276345; background: #d8f2d2; }
.activity-actions { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }
.next-button { min-height: 68px; min-width: 210px; padding: 14px 24px; border: 4px solid var(--ink); border-radius: 20px; background: var(--sun); box-shadow: 0 6px 0 var(--ink); font-weight: 900; font-size: 1.15rem; cursor: pointer; }

.match-bed { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.7fr); align-items: center; gap: clamp(22px, 4vw, 55px); padding: clamp(18px, 4vw, 36px); border: 5px solid var(--soil); border-radius: 36px; background: #f4dca9; box-shadow: inset 0 -18px 0 rgba(112,69,47,.12); }
.target-pot { min-height: 260px; display: grid; place-items: center; padding: 20px; border-radius: 50% 50% 34px 34px; background: #fffdf0; border: 5px dashed #325f51; }
.target-pot p { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 900; }
.shape-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.shape-choice { position: relative; min-width: 0; min-height: 190px; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 28px; background: #fffdf0; cursor: pointer; }
.shape-choice:hover { background: #fff5c9; transform: translateY(-4px); }
.shape-choice.demo-cue { box-shadow: 0 0 0 10px rgba(245,200,66,.6); }
.shape-choice.demo-cue::after { content: "Try this shape friend"; position: absolute; top: -22px; padding: 7px 12px; border-radius: 12px; background: var(--ink); color: white; font-size: .82rem; font-weight: 900; }
.shape-svg { width: clamp(92px, 15vw, 160px); height: clamp(92px, 15vw, 160px); overflow: visible; }
.shape-choice .shape-svg { width: clamp(76px, 12vw, 130px); height: clamp(76px, 12vw, 130px); }
.variant-small { transform: scale(.72); }
.variant-large { transform: scale(1.12); }
.variant-turned { transform: rotate(180deg) scale(.84); }
.wiggle { animation: gentle-wiggle .4s ease-in-out 1; }

.sort-rule { max-width: 700px; margin: 0 auto 22px; padding: 15px 22px; border: 4px solid var(--ink); border-radius: 22px; background: #fff1c5; text-align: center; font-size: 1.25rem; font-weight: 900; }
.sort-workspace { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: stretch; }
.treasure-tray { min-height: 270px; display: grid; place-items: center; padding: 22px; border: 5px solid var(--soil); border-radius: 38px; background: #d7b077; }
.treasure-button { min-width: 170px; min-height: 170px; display: grid; place-items: center; border: 5px solid var(--ink); border-radius: 36px; background: #fffdf0; cursor: pointer; }
.treasure-button[aria-pressed="true"] { box-shadow: 0 0 0 11px var(--sun); transform: translateY(-4px); }
.sort-buckets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.bucket-button { position: relative; min-height: 270px; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 20px; border: 6px solid var(--soil); border-radius: 24px 24px 72px 72px; background: #fffdf0; cursor: pointer; overflow: hidden; }
.bucket-button:disabled { cursor: default; opacity: .72; }
.bucket-button:not(:disabled):hover { transform: translateY(-5px); }
.bucket-cue { width: 120px; height: 90px; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 18px; }
.bucket-label { font-size: 1.1rem; font-weight: 900; }
.pattern-yellow {
  background-color: #f5c842;
  background-image: radial-gradient(circle, #634c00 0 3px, transparent 4px);
  background-size: 18px 18px;
}
.pattern-blue {
  background-color: #9ad1df;
  background-image: radial-gradient(ellipse at 50% 100%, transparent 0 52%, #073f54 54% 62%, transparent 64%);
  background-size: 30px 18px;
}
.sorted-count { display: flex; gap: 7px; min-height: 25px; }
.sorted-count i { width: 22px; height: 22px; border-radius: 50%; background: var(--grass); border: 3px solid var(--ink); }

.count-bed { min-height: 360px; display: grid; grid-template-columns: 1fr; place-items: center; padding: 28px; border: 5px solid var(--soil); border-radius: 44px; background: #d8c48e; }
.count-collection { width: min(620px, 100%); min-height: 230px; position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(16px, 5vw, 44px); padding: 35px; border-radius: 80px 80px 32px 32px; background: #779e55; border: 6px solid var(--grass-dark); }
.count-object { width: clamp(64px, 11vw, 108px); height: clamp(64px, 11vw, 108px); display: grid; place-items: center; opacity: .22; transform: scale(.75); transition: opacity .25s, transform .25s, filter .25s; }
.count-object.is-revealed { opacity: 1; transform: scale(1); }
.count-object.is-counting { filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 18px #f5c842); transform: scale(1.18); }
.object-sprout::before { content: ""; width: 22px; height: 80px; border-left: 9px solid var(--ink); border-radius: 40%; background: radial-gradient(ellipse at 80% 28%, #d7f0a5 0 28%, transparent 30%), radial-gradient(ellipse at 20% 60%, #d7f0a5 0 28%, transparent 30%); }
.object-ladybird { border-radius: 50% 50% 42% 42%; background: radial-gradient(circle at 30% 35%, #17372f 0 7%, transparent 8%), radial-gradient(circle at 70% 55%, #17372f 0 7%, transparent 8%), var(--red); border: 6px solid var(--ink); }
.object-flower { border-radius: 50%; background: var(--sun); box-shadow: 0 -23px 0 #fff0a8, 0 23px 0 #fff0a8, -23px 0 0 #fff0a8, 23px 0 0 #fff0a8; transform-origin: center; }
.object-leaf { border-radius: 100% 0 100% 0; background: #c5e78d; border: 6px solid var(--ink); transform: rotate(-35deg) scale(.75); }
.object-leaf.is-revealed { transform: rotate(-35deg) scale(1); }
.object-leaf.is-counting { transform: rotate(-35deg) scale(1.18); }
.arrangement-arc .count-object:nth-child(2) { transform-origin: center; translate: 0 -35px; }
.arrangement-cluster { flex-wrap: wrap; }
.arrangement-cluster .count-object:nth-child(2) { translate: 0 -40px; }
.arrangement-zigzag .count-object:nth-child(2) { translate: 0 40px; }
.count-choices { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.count-choice { min-height: 150px; padding: 14px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; border: 4px solid var(--ink); border-radius: 28px; background: #fffdf0; cursor: pointer; }
.count-choice:hover { transform: translateY(-4px); background: #fff5c9; }
.choice-seed { width: 34px; height: 45px; border: 4px solid var(--ink); border-radius: 50%; background: #c89458; }
.watching-note { font-weight: 900; text-align: center; }

.summary-screen { min-height: 100vh; display: grid; justify-items: center; align-content: center; text-align: center; background: #fffdf0; }
.summary-garden { min-height: 170px; display: flex; align-items: end; gap: clamp(30px, 7vw, 90px); margin-bottom: 30px; }
.summary-flower { position: relative; width: 65px; height: 150px; border-left: 10px solid var(--grass-dark); }
.summary-flower i { position: absolute; left: -38px; top: -10px; width: 70px; height: 70px; border-radius: 50%; background: var(--sun); box-shadow: 0 -34px 0 #fff0a8, 0 34px 0 #fff0a8, -34px 0 0 #fff0a8, 34px 0 0 #fff0a8; }
.flower-b { height: 120px; }
.flower-b i { background: var(--blue); }
.flower-c { height: 180px; }
.flower-c i { background: var(--red); }
.summary-list { display: grid; gap: 12px; max-width: 760px; margin: 28px auto; text-align: left; }
.summary-list span { display: flex; align-items: center; gap: 15px; padding: 14px 18px; border-radius: 18px; background: #edf2d3; font-weight: 800; }
.mini-shape { flex: 0 0 36px; width: 36px; height: 36px; display: inline-block; background: var(--blue); border: 4px solid var(--ink); }
.mini-shape.circle { border-radius: 50%; }
.mini-shape.square { background: var(--sun); }
.mini-shape.triangle { width: 0; height: 0; background: transparent; border: 20px solid transparent; border-bottom: 36px solid var(--red); border-top: 0; }
.next-practice { max-width: 58ch; font-size: 1.1rem; line-height: 1.45; }

dialog { width: min(650px, calc(100% - 28px)); max-height: 90vh; padding: 0; border: 5px solid var(--ink); border-radius: 30px; background: #fffdf0; color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(18,44,37,.72); backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: clamp(28px, 5vw, 48px); }
.dialog-card p, .dialog-card li { line-height: 1.5; }
.dialog-card li { margin: 9px 0; }
.dialog-close { min-width: 82px; min-height: 64px; float: right; border: 3px solid var(--ink); border-radius: 18px; background: #fff; font-weight: 900; cursor: pointer; }
noscript { display: block; padding: 20px; background: white; color: #7c1830; text-align: center; font-weight: bold; }

@keyframes gentle-wiggle { 0%,100% { transform: rotate(0); } 35% { transform: rotate(-3deg); } 70% { transform: rotate(3deg); } }

@media (max-width: 820px) {
  .path-grid { grid-template-columns: 1fr; max-width: 480px; }
  .path-card { min-height: 280px; border-radius: 90px 90px 30px 30px; }
  .match-bed { grid-template-columns: 1fr; }
  .target-pot { min-height: 190px; }
  .sort-workspace { grid-template-columns: 1fr; }
  .treasure-tray { min-height: 210px; }
  .bucket-button { min-height: 230px; }
}

@media (max-width: 560px) {
  .topbar { min-height: 78px; grid-template-columns: auto 1fr; gap: 4px; padding: 8px 4px; }
  .garden-progress { display: none; }
  .control-cluster { justify-self: end; gap: 4px; }
  .round-control { min-width: 64px; padding: 5px; }
  .round-control span { font-size: 11px; }
  .screen { padding: 24px 12px 40px; }
  .welcome-card { margin-top: -5vh; border-radius: 28px; }
  h1 { font-size: clamp(2.6rem, 14vw, 4rem); }
  h2 { font-size: clamp(2.1rem, 11vw, 3.2rem); }
  .garden-sign { top: 58%; transform: translateX(-50%) scale(.74); }
  .path-card { min-height: 260px; }
  .match-bed { padding: 15px; }
  .shape-choices { gap: 8px; }
  .shape-choice { min-height: 132px; border-radius: 20px; }
  .shape-choice.demo-cue::after { top: -16px; font-size: .68rem; }
  .sort-buckets { gap: 10px; }
  .bucket-button { min-height: 210px; padding: 12px 6px; border-width: 5px; }
  .bucket-cue { width: 92px; height: 74px; }
  .bucket-label { font-size: .92rem; }
  .count-bed { padding: 14px 10px 20px; }
  .count-collection { min-height: 180px; padding: 28px 12px; gap: 10px; }
  .count-choices { gap: 8px; }
  .count-choice { min-height: 120px; padding: 8px; }
  .choice-seed { width: 26px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --ink: #09231d; --focus: #0000d4; }
  button { border-width: 5px; }
}
