:root {
  color-scheme: light;
  --ink: #173f35;
  --muted: #63786f;
  --paper: #fffaf0;
  --green: #4d8b68;
  --green-dark: #2b654c;
  --leaf-soft: #e9f1df;
  --mustard: #dfa942;
  --terracotta: #bc654d;
  --line: rgba(41, 96, 72, .16);
  --shadow: 0 18px 45px rgba(48, 72, 61, .13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 2%, rgba(226, 173, 64, .2), transparent 24rem),
    radial-gradient(circle at 95% 20%, rgba(74, 139, 104, .18), transparent 30rem),
    #f4ecdc;
  font-family: "Segoe UI", Arial, sans-serif;
}

button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 4px solid rgba(224, 167, 57, .6); outline-offset: 3px; }

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 46px;
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 24px;
  background: rgba(255,250,240,.91);
  box-shadow: 0 10px 28px rgba(58,75,62,.09);
  backdrop-filter: blur(9px);
}

.game-brand { display: flex; align-items: center; min-width: 0; gap: 13px; }
.game-brand > span:last-child { display: grid; min-width: 0; gap: 2px; }
.game-brand strong { font-size: clamp(18px, 2vw, 24px); line-height: 1.12; }
.game-brand small { color: var(--muted); font-size: 13px; }

.game-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #6b9b62, #347257);
  box-shadow: inset 0 1px rgba(255,255,255,.32), 0 8px 18px rgba(37,103,79,.2);
}

.game-icon svg { width: 43px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linejoin: round; stroke-linecap: round; }
.age-pill { flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; color: #694b22; background: #ffe2a2; font-size: 14px; font-weight: 850; }

.screen {
  display: none;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 34px;
  background: rgba(255,251,243,.95);
  box-shadow: var(--shadow);
}
.screen.is-active { display: grid; }

.eyebrow { margin: 0 0 7px; color: var(--green-dark); font-size: 12px; font-weight: 900; letter-spacing: .11em; }
.hero-copy h1, .section-title h2, .task-head h2, .result-copy h2 { margin: 0; color: var(--ink); line-height: 1.07; letter-spacing: -.035em; }

.home-screen {
  grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr);
  gap: 28px 34px;
  padding: clamp(26px,4vw,48px);
  overflow: hidden;
}

.hero-copy { align-self: center; }
.hero-copy h1 { max-width: 500px; font-size: clamp(34px,4.5vw,54px); }
.hero-copy > p:not(.eyebrow) { max-width: 540px; margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.58; }
.hero-facts, .result-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 25px; }
.hero-facts span, .result-facts span { padding: 8px 12px; border-radius: 999px; color: #3e6257; background: #edf4e8; font-size: 14px; font-weight: 850; }

.primary-button, .secondary-button, .hint-button, .next-button, .route-card button {
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.primary-button, .next-button { padding: 14px 20px; color: #fff; background: linear-gradient(145deg,#5a946f,#317155); box-shadow: 0 9px 20px rgba(38,104,79,.22); }
.primary-button:hover, .next-button:hover, .secondary-button:hover, .hint-button:hover, .route-card button:hover { transform: translateY(-2px); filter: saturate(1.06); }

.hero-garden {
  position: relative;
  align-self: center;
  min-width: 0;
  aspect-ratio: 1.17;
  overflow: hidden;
  border: 1px solid rgba(49,113,82,.14);
  border-radius: 30px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.7),transparent 44%),
    linear-gradient(180deg,#dcebdc 0 61%,#c8a471 61% 66%,#aa7b4b 66% 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.78), 0 15px 35px rgba(45,85,65,.12);
}

.hero-garden::before {
  content: "";
  position: absolute;
  inset: auto 0 34% 0;
  height: 26%;
  opacity: .75;
  background: radial-gradient(ellipse at 9% 100%,#719b6d 0 42%,transparent 43%), radial-gradient(ellipse at 38% 100%,#82a777 0 40%,transparent 41%), radial-gradient(ellipse at 71% 100%,#6f9668 0 43%,transparent 44%), radial-gradient(ellipse at 98% 100%,#8bad75 0 40%,transparent 41%);
}

.hero-plant { position: absolute; z-index: 2; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(48,55,42,.16)); }
.hero-sunflower { left: -2%; bottom: 2%; width: 36%; }
.hero-strawberry { right: -2%; bottom: 1%; width: 34%; }
.hero-birch { top: 0; right: 1%; width: 30%; opacity: .92; }

.hero-tiles { position: absolute; z-index: 3; top: 25%; left: 28%; display: grid; grid-template-columns: repeat(3,57px); grid-template-rows: repeat(3,57px); gap: 5px; transform: rotate(-4deg); }
.hero-tiles i { display: grid; grid-column: var(--x); grid-row: var(--y); place-items: center; border: 2px solid #6a9975; border-radius: 11px; color: #285b47; background: #fff8dd; box-shadow: 0 5px 0 #d4bd83,0 8px 12px rgba(61,68,52,.14); font-style: normal; font-size: 15px; font-weight: 950; }

.how-strip { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.how-strip article { display: flex; align-items: center; min-width: 0; gap: 12px; padding: 15px; border: 1px solid rgba(48,104,79,.12); border-radius: 18px; background: rgba(255,255,255,.65); }
.how-strip article > b { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: #fff; background: var(--green); }
.how-strip span { display: grid; gap: 3px; }
.how-strip strong { font-size: 15px; }
.how-strip small { color: var(--muted); line-height: 1.38; }

.routes-screen, .play-screen { padding: clamp(22px,3.4vw,38px); }
.section-title, .task-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-title h2 { font-size: clamp(30px,4vw,44px); }
.section-title > p { margin: 0; color: var(--muted); font-weight: 750; }
.route-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 26px; }

.route-card {
  display: grid;
  grid-template-rows: 126px auto 1fr auto;
  min-width: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb,var(--accent),transparent 76%);
  border-radius: 25px;
  background: linear-gradient(160deg,#fff 0 46%,var(--soft) 100%);
  box-shadow: 0 12px 26px rgba(49,75,61,.1);
}

.route-preview { position: relative; display: flex; align-items: end; justify-content: center; }
.route-preview::after { content: ""; position: absolute; right: 5%; bottom: 5px; left: 5%; height: 8px; border-radius: 50%; background: color-mix(in srgb,var(--accent),transparent 75%); }
.route-preview span { z-index: 1; display: grid; place-items: center; width: 38%; aspect-ratio: 1; margin: 0 -8px; border: 2px solid #fff; border-radius: 20px 20px 12px 12px; background: var(--soft); box-shadow: 0 7px 14px rgba(50,64,52,.1); }
.route-preview span:nth-child(2) { z-index: 2; width: 44%; }
.route-preview img { width: 94%; height: 94%; object-fit: contain; }
.route-copy { margin-top: 10px; text-align: center; }
.route-copy h3 { margin: 0; font-size: 23px; }
.route-copy p { margin: 7px 0 0; color: var(--muted); line-height: 1.45; }
.route-progress { align-self: end; display: grid; gap: 7px; margin: 18px 0 14px; }
.route-progress > span { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(35,79,62,.1); }
.route-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.route-progress b { color: var(--muted); font-size: 13px; text-align: center; }
.route-card button { align-self: end; width: 100%; padding: 12px 14px; color: #fff; background: var(--accent); box-shadow: 0 8px 16px color-mix(in srgb,var(--accent),transparent 72%); }
.text-button { justify-self: start; margin-top: 22px; padding: 8px 2px; border: 0; color: var(--green-dark); background: transparent; cursor: pointer; font-weight: 850; }

.task-head { justify-content: flex-start; }
.task-head > div { flex: 1; min-width: 0; }
.task-head h2 { font-size: clamp(24px,3vw,34px); }
.round-button { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 15px; color: var(--green-dark); background: #fff; cursor: pointer; font-size: 24px; font-weight: 900; }
.counter { flex: 0 0 auto; padding: 9px 12px; border-radius: 999px; color: var(--green-dark); background: #edf4e8; font-weight: 900; }
.task-progress { height: 8px; margin: 17px 0 22px; overflow: hidden; border-radius: 999px; background: rgba(45,105,80,.1); }
.task-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#dfac43,#4a9570); transition: width .25s ease; }

.crossword-workspace { display: grid; grid-template-columns: minmax(260px,.72fr) minmax(0,1.28fr); align-items: start; gap: 18px; }
.clue-book, .grid-card, .syllable-bed { min-width: 0; border: 1px solid rgba(46,102,78,.13); border-radius: 26px; background: #fffdf7; box-shadow: 0 12px 28px rgba(49,72,60,.1); }
.clue-book { display: grid; gap: 14px; padding: 20px; }
.clue-picture { display: grid; place-items: center; min-height: 205px; overflow: hidden; border-radius: 21px; background: radial-gradient(circle at 50% 82%,rgba(219,190,127,.4),transparent 45%), linear-gradient(160deg,#f7edda,#e9f2e7); }
.clue-picture img { width: 85%; height: 202px; object-fit: contain; filter: drop-shadow(0 8px 7px rgba(52,62,47,.17)); }
.clue-copy h3 { margin: 0; font-size: 24px; }
.clue-copy > p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.known-letters { display: grid; gap: 8px; padding-top: 12px; border-top: 1px dashed #cbbb96; }
.known-letters > span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.known-letters > div { display: flex; flex-wrap: wrap; gap: 4px; }
.pattern-cell { display: grid; place-items: center; width: 27px; height: 34px; border: 2px solid #cdbb8e; border-radius: 9px; color: #9b8a6f; background: #fff9e9; font-size: 16px; font-weight: 900; }
.pattern-cell.is-known { color: var(--ink); border-color: #72a487; background: #e4f0df; }
.pattern-cell.is-draft { color: #744e21; border-color: #d1a953; background: #fff0b7; }

.grid-card { padding: clamp(12px,2.3vw,22px); }
.crossword-grid-wrap { display: grid; place-items: center; min-height: 458px; padding: 10px; border-radius: 20px; background: linear-gradient(rgba(255,255,255,.6),rgba(255,255,255,.25)), repeating-linear-gradient(0deg,transparent 0 24px,rgba(63,127,99,.045) 24px 25px), repeating-linear-gradient(90deg,transparent 0 24px,rgba(63,127,99,.045) 24px 25px), #edf4e8; }
.crossword-grid { display: grid; grid-template-columns: repeat(var(--cols),minmax(0,1fr)); grid-template-rows: repeat(var(--rows),minmax(0,1fr)); gap: 3px; width: min(100%,calc(var(--cols) * 50px)); }
.crossword-gap { aspect-ratio: 1; }
.crossword-cell { position: relative; display: grid; aspect-ratio: 1; place-items: center; min-width: 0; padding: 0; border: 2px solid #c8b68e; border-radius: 8px; color: var(--ink); background: #fff9e9; box-shadow: inset 0 -3px rgba(134,102,55,.08),0 3px 7px rgba(53,70,57,.08); cursor: default; }
.crossword-cell.is-active { border-color: #6d9d7d; background: #f0f7e8; }
.crossword-cell.is-draft { border-color: #d1a14a; background: #fff0b4; }
.crossword-cell.is-locked { border-color: #579371; color: #215844; background: #dff0df; }
.crossword-cell:disabled { opacity: 1; }
.crossword-cell small { position: absolute; top: 2px; left: 3px; color: #7b6c4e; font-size: clamp(7px,.8vw,10px); line-height: 1; }
.crossword-cell b { font-size: clamp(11px,1.8vw,21px); line-height: 1; }

.clue-tabs { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; margin-top: 15px; }
.clue-tab { position: relative; display: grid; place-items: center; min-width: 0; padding: 5px; border: 2px solid transparent; border-radius: 14px; background: #f3ead8; cursor: pointer; }
.clue-tab span { display: grid; place-items: center; width: 100%; aspect-ratio: 1.2; }
.clue-tab img { width: 94%; height: 94%; object-fit: contain; }
.clue-tab b { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #fff; background: #6f7d72; font-size: 12px; }
.clue-tab.is-active { border-color: var(--green); background: #e7f2e5; }
.clue-tab.is-solved { background: #dff0df; }
.clue-tab.is-solved b { background: var(--green); }
.clue-tab:disabled { opacity: 1; cursor: default; }

.syllable-bed { grid-column: 1/-1; display: grid; grid-template-columns: minmax(200px,.78fr) minmax(240px,1fr); gap: 14px 18px; padding: 20px; background: linear-gradient(165deg,#fffdf7,#f6edda); }
.assembled-row { display: grid; gap: 8px; }
.assembled-row > span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.assembled-row > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 52px; }
.assembled-slot { display: grid; place-items: center; min-width: 60px; min-height: 46px; padding: 7px 12px; border: 2px dashed #cbb98c; border-radius: 13px; color: #a09273; background: rgba(255,255,255,.65); font-weight: 950; }
.assembled-slot.is-filled { border-style: solid; border-color: #74a185; color: #245a44; background: #e3f0df; box-shadow: 0 4px 0 #b8d0b7; }
.feedback { display: grid; min-height: 68px; gap: 3px; padding: 12px 14px; border: 1px solid rgba(47,105,81,.13); border-radius: 15px; background: #f1f5e9; }
.feedback b { font-size: 15px; }
.feedback span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.feedback.is-wrong { border-color: rgba(190,89,70,.24); background: #fff0e8; }
.feedback.is-wrong b { color: #a64f3f; }
.feedback.is-right { background: #eaf4e6; }
.feedback.is-hint { border-color: rgba(198,144,42,.28); background: #fff5cf; }
.feedback.is-success { border-color: rgba(44,127,87,.27); background: #def1e1; }
.syllable-palette { display: flex; flex-wrap: wrap; align-content: start; gap: 9px; }
.syllable-button { min-width: 62px; min-height: 49px; padding: 8px 13px; border: 1px solid #d6bb7b; border-radius: 13px; color: #285a47; background: #fff6d9; box-shadow: 0 5px 0 #d7b977; cursor: pointer; font-size: 18px; font-weight: 950; transition: transform .14s ease,background .14s ease; }
.syllable-button:hover { transform: translateY(-2px); background: #ffedb7; }
.syllable-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #d7b977; }
.syllable-button.is-used { color: #527066; background: #e4ecdf; box-shadow: none; opacity: .62; }
.syllable-button.is-wrong { color: #a94738; background: #ffd8cb; animation: soft-shake .32s ease; }
.clue-actions { display: flex; align-items: end; justify-content: flex-end; gap: 10px; }
.hint-button, .secondary-button { padding: 12px 16px; color: #72521e; background: #ffe4a1; box-shadow: 0 7px 15px rgba(154,111,31,.13); }
.next-button { padding: 12px 17px; }

.result-screen { grid-template-columns: minmax(0,.96fr) minmax(0,1.04fr); align-items: center; gap: 32px; padding: clamp(28px,5vw,58px); overflow: hidden; }
.result-garden { display: flex; align-items: end; justify-content: center; min-height: 340px; padding: 25px; border-radius: 29px; background: radial-gradient(circle at 50% 86%,rgba(224,184,102,.45),transparent 37%), linear-gradient(160deg,#eef5e8,#dbead7); }
.result-garden span { position: relative; display: grid; place-items: center; width: 36%; margin: 0 -9px; }
.result-garden span:nth-child(2) { z-index: 2; width: 43%; }
.result-garden img { width: 100%; height: 235px; object-fit: contain; filter: drop-shadow(0 9px 8px rgba(45,65,50,.16)); }
.result-garden b { position: absolute; right: 4px; bottom: 3px; display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--green); font-size: 18px; }
.result-copy h2 { font-size: clamp(34px,4.3vw,51px); }
.result-copy > p:not(.eyebrow) { margin: 17px 0 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.result-facts b { font-size: 17px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.secondary-button { padding: 14px 18px; }

@keyframes soft-shake { 0%,100% { transform: translateX(0); } 35% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }

@media (max-width: 900px) {
  .home-screen { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-copy h1, .hero-copy > p:not(.eyebrow) { margin-right: auto; margin-left: auto; }
  .hero-facts { justify-content: center; }
  .hero-garden { justify-self: center; width: min(100%,570px); }
  .crossword-workspace { grid-template-columns: 1fr; }
  .clue-book { grid-template-columns: 210px 1fr; }
  .clue-picture { grid-row: 1/3; }
  .known-letters { align-self: end; }
  .grid-card { grid-row: 2; }
  .syllable-bed { grid-row: 3; }
}

@media (max-width: 780px) {
  .app { width: min(1120px,calc(100% - 22px)); margin-top: 16px; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { grid-template-columns: 150px 1fr; grid-template-rows: auto 1fr auto auto; column-gap: 18px; }
  .route-preview { grid-row: 1/5; }
  .route-copy { text-align: left; }
  .route-progress b { text-align: left; }
  .how-strip { grid-template-columns: 1fr; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .syllable-bed { grid-template-columns: 1fr; }
  .clue-actions { justify-content: flex-start; }
  .result-screen { grid-template-columns: 1fr; text-align: center; }
  .result-garden { min-height: 280px; }
  .result-facts, .result-actions { justify-content: center; }
}

@media (max-width: 540px) {
  .game-head { padding: 10px 12px; border-radius: 20px; }
  .game-icon { width: 46px; height: 46px; border-radius: 15px; }
  .game-icon svg { width: 36px; }
  .game-brand small { display: none; }
  .age-pill { padding: 7px 10px; font-size: 12px; }
  .screen { border-radius: 25px; }
  .home-screen, .routes-screen, .play-screen, .result-screen { padding: 18px; }
  .hero-copy h1 { font-size: 34px; }
  .hero-copy > p:not(.eyebrow), .result-copy > p:not(.eyebrow) { font-size: 16px; }
  .hero-garden { aspect-ratio: 1.06; }
  .hero-tiles { top: 24%; left: 27%; grid-template-columns: repeat(3,45px); grid-template-rows: repeat(3,45px); }
  .hero-tiles i { font-size: 12px; }
  .route-card { grid-template-columns: 112px 1fr; column-gap: 12px; padding: 14px; }
  .route-copy h3 { font-size: 20px; }
  .route-preview span { border-radius: 14px; }
  .task-head { gap: 10px; }
  .task-head h2 { font-size: 21px; }
  .round-button { width: 42px; height: 42px; }
  .counter { padding: 7px 9px; }
  .clue-book { grid-template-columns: 1fr; padding: 14px; }
  .clue-picture { grid-row: auto; min-height: 170px; }
  .clue-picture img { height: 168px; }
  .crossword-grid-wrap { min-height: 330px; padding: 6px; }
  .grid-card { padding: 10px; }
  .crossword-grid { gap: 2px; }
  .crossword-cell { border-width: 1.5px; border-radius: 5px; }
  .crossword-cell small { top: 1px; left: 2px; font-size: 6px; }
  .crossword-cell b { font-size: clamp(10px,3.4vw,15px); }
  .clue-tabs { gap: 4px; }
  .clue-tab { padding: 2px; border-radius: 10px; }
  .clue-tab b { width: 19px; height: 19px; font-size: 10px; }
  .syllable-bed { padding: 14px; }
  .assembled-slot { min-width: 54px; min-height: 42px; padding: 6px 9px; }
  .syllable-button { min-width: 58px; min-height: 46px; padding: 7px 11px; font-size: 17px; }
  .clue-actions { display: grid; grid-template-columns: 1fr; }
  .clue-actions button { width: 100%; }
  .result-garden { min-height: 230px; padding: 15px; }
  .result-garden img { height: 180px; }
  .result-copy h2 { font-size: 34px; }
}

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