:root {
  color-scheme: light;
  --ink: #20382c;
  --muted: #4d6253;
  --green: #275e43;
  --line: #d9dfd1;
  --paper: #fffefa;
  --ground: #f7f7ed;
  font-family: 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible + span { outline: 3px solid #163e7a; outline-offset: 4px; }
[hidden] { display: none !important; }
.masthead {
  min-height: 74px;
  padding: 10px max(20px, calc((100% - 1140px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dee3d5;
  background: #fffef8;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.08rem; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  color: #fff7d5;
  background: var(--green);
  font-size: 26px;
  line-height: 1;
}
.pace {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 100px;
  color: #284d37;
  background: #eaf1df;
  padding: 8px 13px;
  font-size: .88rem;
  font-weight: 700;
  text-align: center;
}
.pace span { width: 7px; height: 7px; border-radius: 50%; background: #477456; flex: none; }
.pace strong { font-weight: inherit; }
main { max-width: 1180px; margin: auto; padding: 37px 20px 44px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: -10px 0 8px;
  color: var(--green);
  font-weight: 700;
  text-underline-offset: 3px;
}
.back-link:focus-visible { outline: 3px solid #163e7a; outline-offset: 4px; border-radius: 4px; }
.intro h1 {
  font-family: Georgia, serif;
  font-weight: 500;
  letter-spacing: -.053em;
  font-size: clamp(2.65rem, 7.2vw, 5.1rem);
  line-height: 1.03;
  margin: 0 0 11px;
}
.intro h1 span { color: #8a570e; }
.intro p { margin: 0; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.22rem); line-height: 1.5; }
.layout { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: 20px; align-items: start; }
.game, aside {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 6px 20px #33402f08;
}
.game { padding: 17px; }
.game-head { display: flex; min-height: 59px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 13px; }
.count { display: grid; gap: 2px; }
.eyebrow { color: var(--muted); font-size: .85rem; font-weight: 700; }
.count strong { font-size: 1.53rem; line-height: 1.2; }
.count strong span { color: var(--muted); font-size: 1.04rem; font-weight: 500; }
.round-points { color: var(--green); font-size: .83rem; font-weight: 700; }
.progress { display: flex; gap: clamp(3px, 1vw, 7px); }
.progress i { width: clamp(8px, 2vw, 15px); aspect-ratio: 1; border-radius: 50%; background: #e8ecdf; border: 1px solid #cdd6c4; }
.progress i.filled { background: #306345; border-color: #306345; }
.clock {
  flex: none;
  min-width: 4.25rem;
  padding: 6px 10px;
  border: 1px solid #a4b5a1;
  border-radius: 10px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: #eaf1df;
}
.clock[data-low] { color: #6b3915; background: #fff0cb; border-color: #c79656; }
.game-head:has(.clock:not([hidden])) .progress { display: none; }
.board {
  position: relative;
  isolation: isolate;
  height: clamp(360px, 53vh, 490px);
  border-radius: 17px;
  border: 1px solid #cedbc8;
  background: radial-gradient(circle at 1px 1px, #9eb59975 1px, transparent 1.35px) 9px 9px / 19px 19px, radial-gradient(ellipse at 50% 45%, #f5f5dc, #e3eedb 84%);
}
.playfield { position: absolute; inset: 0 0 128px; display: grid; place-items: center; }
.board[data-finished] .playfield { align-items: start; }
.board[data-finished] #finished { padding-top: clamp(18px, 5vh, 38px); }
.basket-dock {
  position: absolute;
  bottom: 7px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 3px;
  transform: translateX(-50%);
  pointer-events: none;
}
.basket { position: relative; width: 170px; height: 100px; transform-origin: bottom center; }
.basket-label { color: #46604e; font-size: .78rem; font-weight: 700; }
.board[data-finished] .basket { transform: scale(1.48); }
.board[data-finished] .basket-dock { bottom: 16px; }
.board[data-finished] .basket-label { visibility: hidden; }
.basket-body, .basket-rim { position: absolute; left: 50%; transform: translateX(-50%); }
.basket-body {
  bottom: 0;
  width: 112px;
  height: 38px;
  overflow: hidden;
  border: 2px solid #845122;
  border-radius: 8px 8px 28px 28px / 8px 8px 23px 23px;
  background: repeating-linear-gradient(10deg, #8a532c22 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-32deg, #fff3d060 0 2px, transparent 2px 6px), #d99548;
  box-shadow: inset 0 -5px #8f502520, 0 4px 6px #76532b25;
}
.basket-band {
  position: absolute;
  inset: 13px 0 auto;
  height: 7px;
  background: #f1b963;
  border-block: 1px solid #93623770;
}
.basket-rim {
  bottom: 31px;
  width: 122px;
  height: 10px;
  border: 2px solid #845122;
  border-radius: 10px;
  background: repeating-linear-gradient(115deg, #ffe4a8 0 4px, #edb666 4px 8px);
}
.bouquet { position: absolute; inset: 0; }
.stem {
  --petal: #ffc34d;
  --center: #754319;
  --leaf: #54855b;
  position: absolute;
  left: var(--x);
  bottom: 26px;
  width: 3px;
  height: var(--height);
  border-radius: 2px;
  background: #376344;
  transform: rotate(var(--tilt));
  transform-origin: center bottom;
}
.stem:nth-child(1) { --x: 84px; --height: 68px; --tilt: -1deg; }
.stem:nth-child(2) { --x: 69px; --height: 47px; --tilt: -35deg; }
.stem:nth-child(3) { --x: 104px; --height: 48px; --tilt: 34deg; }
.stem:nth-child(4) { --x: 61px; --height: 43px; --tilt: -58deg; }
.stem:nth-child(5) { --x: 110px; --height: 45px; --tilt: 55deg; }
.stem:nth-child(6) { --x: 75px; --height: 61px; --tilt: -22deg; }
.stem:nth-child(7) { --x: 94px; --height: 62px; --tilt: 24deg; }
.stem:nth-child(8) { --x: 89px; --height: 34px; --tilt: -8deg; }
.stem[data-color="pink"] { --petal: #e9788d; --center: #87374d; }
.stem[data-color="lilac"] { --petal: #a989d5; --center: #573677; }
.stem::before, .stem::after {
  content: '';
  position: absolute;
  width: 17px;
  height: 8px;
  background: var(--leaf);
  border-radius: 90% 0 90% 0;
}
.stem::before { left: 0; bottom: 24%; transform: rotate(-23deg); }
.stem::after { right: 0; bottom: 43%; transform: rotate(35deg) scaleX(-1); }
.stem i {
  position: absolute;
  top: -11px;
  left: -12px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  filter: drop-shadow(0 1px 1px #513b2e42);
  background:
    radial-gradient(circle at center, #ffe7a7 0 9%, var(--center) 10% 20%, transparent 23%),
    radial-gradient(circle at 50% 22%, var(--petal) 0 20%, transparent 23%),
    radial-gradient(circle at 75% 36%, var(--petal) 0 20%, transparent 23%),
    radial-gradient(circle at 75% 64%, var(--petal) 0 20%, transparent 23%),
    radial-gradient(circle at 50% 78%, var(--petal) 0 20%, transparent 23%),
    radial-gradient(circle at 25% 64%, var(--petal) 0 20%, transparent 23%),
    radial-gradient(circle at 25% 36%, var(--petal) 0 20%, transparent 23%);
}
@media (prefers-reduced-motion: no-preference) {
  .stem:not([hidden]) i { animation: bloom-in .35s ease-out both; }
  @keyframes bloom-in {
    from { opacity: .35; transform: scale(.55); }
    70% { transform: scale(1.12); }
    to { opacity: 1; transform: scale(1); }
  }
}
.target {
  --size: clamp(96px, 16vw, 122px);
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: 3px solid #316447;
  border-radius: 50%;
  background: #fffdf0;
  box-shadow: 0 4px 0 #316447, 0 0 0 8px #fcfff275;
}
.target[data-size="extra"] { --size: clamp(120px, 21vw, 164px); }
.target[data-size="medium"] { --size: clamp(74px, 12vw, 88px); }
.target[data-size="medium"][data-stage="2"] { --size: clamp(65px, 10vw, 78px); }
.target[data-size="medium"][data-stage="3"] { --size: clamp(56px, 9vw, 68px); }
.target:disabled { cursor: default; opacity: 1; }
@media (hover: hover) { .target:hover:enabled { background: #fff3c9; } }
.target:active:enabled, .target[data-collecting] { background: #ffe39a; box-shadow: 0 1px 0 #316447, 0 0 0 8px #fcfff275; }
.flower { position: relative; width: 72%; height: 72%; pointer-events: none; }
.flower i {
  position: absolute;
  top: 2%;
  left: 36%;
  width: 28%;
  height: 40%;
  background: #f9be56;
  border: 1px solid #a86a24;
  border-radius: 65% 65% 50% 50%;
  transform-origin: 50% 120%;
}
.flower i:nth-child(2) { transform: rotate(45deg); }
.flower i:nth-child(3) { transform: rotate(90deg); }
.flower i:nth-child(4) { transform: rotate(135deg); }
.flower i:nth-child(5) { transform: rotate(180deg); }
.flower i:nth-child(6) { transform: rotate(225deg); }
.flower i:nth-child(7) { transform: rotate(270deg); }
.flower i:nth-child(8) { transform: rotate(315deg); }
.target[data-color="pink"] .flower i { background: #f7a7ab; border-color: #9c4c58; }
.target[data-color="lilac"] .flower i { background: #c9b2ee; border-color: #7653a7; }
.flower b { position: absolute; inset: 32%; border-radius: 50%; background: #714016; border: 2px solid #fff0ae; }
.game-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 12px; }
.game-actions button, .primary {
  min-height: 48px;
  border: 1px solid #cbd6c8;
  border-radius: 12px;
  background: #f8faf3;
  color: var(--ink);
  padding: 8px 16px;
  font-weight: 700;
}
.game-actions button span { padding-right: 4px; }
.game-actions button:hover:enabled { background: #e7efdf; }
.game-actions button:disabled { opacity: .55; cursor: default; }
.game-actions .demo-button { border-color: #74917b; background: #eaf2e5; }
.game-actions .demo-button[data-active] { background: var(--green); color: white; }
.game-actions .demo-button[data-active]:hover { background: #1d4934; }
.board-message { padding: 16px; text-align: center; }
.message-icon { color: var(--green); font-size: 2rem; }
.board-message h2 { margin: 3px 0 12px; font-family: Georgia, serif; font-size: clamp(1.85rem, 5vw, 2.6rem); font-weight: 500; }
.board-message p { margin: 0 0 16px; }
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.primary:hover { background: #1d4934; }
aside { padding: 22px; }
aside h2 { margin: 0 0 12px; font-family: Georgia, serif; font-size: 1.6rem; font-weight: 500; }
.steps { margin: 0; padding-inline-start: 22px; color: var(--muted); line-height: 1.45; }
.steps li + li { margin-top: 6px; }
.levels { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.level-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.level-options button, summary {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #74917b;
  border-radius: 10px;
  color: var(--ink);
  background: #f8faf3;
  font-weight: 700;
}
.level-options button[aria-pressed="true"] { background: var(--green); color: white; }
.level-options #hardest { grid-column: 1 / -1; }
.stages { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf3; }
.stages h3 { margin: 0 0 7px; font-size: .95rem; }
.stages p { margin: 8px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.stage-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stage-options button:disabled { color: #57665a; background: #ecefe7; border-color: #c1cbbd; cursor: default; }
.level-description { min-height: 2.8em; margin: 9px 0; color: var(--muted); font-size: .91rem; line-height: 1.4; }
summary { cursor: pointer; align-content: center; touch-action: manipulation; }
summary:focus-visible { outline: 3px solid #163e7a; outline-offset: 4px; }
details[open] summary { margin-bottom: 14px; }
details fieldset:last-child { margin-bottom: 0; }
fieldset { min-width: 0; margin: 0 0 19px; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.options { display: grid; gap: 6px; }
.options label { position: relative; cursor: pointer; }
.options input, .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.options span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
}
.options span::before { content: ''; box-sizing: border-box; flex: none; width: 17px; height: 17px; border: 1px solid #7b8e7c; border-radius: 50%; background: #fff; }
.options input:checked + span { background: #eaf2e5; border-color: #74917b; font-weight: 700; }
.options input:checked + span::before { border: 5px solid var(--green); }
@media (max-width: 740px) {
  main { padding-top: 25px; }
  .layout { grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
}
@media (max-width: 390px) {
  main { padding-inline: 12px; }
  .masthead { padding-inline: 12px; }
  .brand { gap: 7px; font-size: .93rem; }
  .brand-icon { width: 34px; height: 34px; font-size: 22px; }
  .pace { font-size: .75rem; padding-inline: 8px; }
  .game { padding: 11px; }
}
