:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #304d49;
  --muted: #71817d;
  --paper: #fffdf8;
  --line: #ddd4b8;
  --green: #55a779;
  --gold: #d99c45;
  --coral: #e77968;
  --purple: #8172b2;
  --shadow: 0 19px 46px rgba(58, 75, 68, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #f3f7ed; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 13%, rgba(225, 164, 76, .18) 0 140px, transparent 142px),
    radial-gradient(circle at 94% 29%, rgba(108, 164, 191, .14) 0 170px, transparent 172px),
    linear-gradient(145deg, #f1f7ec, #fff9ee 54%, #f1eef9);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .14;
  background-image: radial-gradient(#738e86 1.2px, transparent 1.2px);
  background-size: 29px 29px;
  content: "";
}
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(217, 156, 69, .72); outline-offset: 4px; }
button:disabled { cursor: default; }
h1, h2, p { margin-top: 0; }
.app { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 20px 0 48px; }
.loading-card {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  gap: 12px;
  margin-top: 60px;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 42px;
  box-shadow: var(--shadow);
}
.loading-card span { padding: 15px; color: white; font-size: 37px; font-weight: 900; background: var(--green); border-radius: 19px; transform: rotate(-4deg); }
.loading-card p { color: var(--muted); font-weight: 900; }
.topbar, .brand, .top-actions, .section-heading, .game-head, .builder-head, .feedback, .animal-note { display: flex; align-items: center; }
.topbar { min-height: 68px; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.brand { gap: 12px; padding: 0; text-align: left; background: none; border: 0; }
.brand-mark {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: white;
  font-size: 19px;
  font-weight: 900;
  background: var(--green);
  border: 3px solid #347a58;
  border-radius: 19px;
  box-shadow: 0 7px 16px rgba(65, 84, 76, .12);
  transform: rotate(-4deg);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 24px; font-weight: 900; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { gap: 10px; }
.letter-sparkles { color: var(--coral); font-family: Georgia, serif; font-size: 20px; font-weight: 900; }
.sound-button, .back-button { min-width: 48px; min-height: 48px; font-weight: 900; background: rgba(255, 253, 248, .95); border: 2px solid var(--line); border-radius: 17px; }
.sound-button { display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 13px; }
.back-button { padding: 0; font-size: 22px; }
.eyebrow { margin: 0 0 8px; color: #3d7e64; font-family: Georgia, serif; font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.primary-button, .secondary-button, .hint-button, .tool-button, .check-button { min-width: 44px; min-height: 52px; border-radius: 17px; font-weight: 900; }
.primary-button, .check-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; color: white; background: #409775; border: 0; box-shadow: 0 8px 0 #2e795e; }
.primary-button:active, .check-button:active { transform: translateY(4px); box-shadow: 0 4px 0 #2e795e; }
.primary-button.compact { min-height: 46px; box-shadow: none; }
.secondary-button, .tool-button { padding: 0 20px; background: white; border: 2px solid var(--line); }
.hint-button { padding: 0 17px; background: #fff1c5; border: 2px solid #dbc36e; }
.hero {
  display: grid;
  min-height: 520px;
  align-items: center;
  grid-template-columns: 1.04fr .96fr;
  gap: 44px;
  padding: clamp(40px, 6vw, 68px);
  overflow: hidden;
  background: rgba(255, 253, 248, .97);
  border: 3px solid var(--line);
  border-radius: 46px;
  box-shadow: var(--shadow);
}
.hero h1 { max-width: 620px; margin-bottom: 19px; font-size: clamp(46px, 5.4vw, 66px); font-weight: 900; letter-spacing: -.055em; line-height: .98; }
.hero-copy > p:not(.eyebrow) { max-width: 560px; margin-bottom: 27px; color: var(--muted); font-size: 18px; font-weight: 800; line-height: 1.52; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 29px; }
.hero-facts span { color: var(--muted); font-size: 13px; font-weight: 900; }
.hero-facts strong { margin-right: 4px; color: var(--ink); font-size: 24px; }
.hero-art { min-height: 390px; }
.hero-board {
  position: relative;
  height: 380px;
  overflow: hidden;
  background: linear-gradient(#ecf5e8 0 67%, #e8c979 68%);
  border: 4px solid #53635e;
  border-radius: 42% 42% 30px 30px;
  box-shadow: 14px 15px 0 rgba(62, 78, 71, .13);
}
.hero-board::before { position: absolute; inset: 0 0 32%; background: radial-gradient(circle at 50% 65%, rgba(255, 255, 255, .86), transparent 46%); content: ""; }
.hero-source { position: absolute; top: 48px; left: 28px; z-index: 2; width: 225px; padding: 17px; text-align: center; background: white; border: 4px solid #53635e; border-radius: 23px; transform: rotate(-3deg); }
.hero-source small, .hero-source strong { display: block; }
.hero-source small { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.hero-source strong { font-size: 29px; letter-spacing: .05em; }
.hero-found { position: absolute; z-index: 3; display: flex; min-height: 54px; align-items: center; gap: 10px; padding: 0 15px; font-size: 21px; font-weight: 900; background: #fff6d6; border: 3px solid #53635e; border-radius: 16px; }
.hero-found span { color: var(--green); }
.word-one { top: 152px; left: 50px; transform: rotate(4deg); }
.word-two { top: 222px; left: 93px; transform: rotate(-3deg); }
.hero-board img { position: absolute; right: 2px; bottom: 8px; width: 190px; height: 190px; object-fit: contain; }
.pencil { position: absolute; top: 30px; right: 31px; color: var(--coral); font-size: 48px; transform: rotate(-12deg); }
.how-section, .levels-section { margin-top: 30px; padding: 38px; background: rgba(255, 253, 248, .84); border: 2px solid rgba(221, 212, 184, .86); border-radius: 36px; }
.section-heading { justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.section-heading h2 { max-width: 650px; margin: 0; font-size: 30px; }
.section-heading > p { max-width: 410px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; text-align: right; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.steps-grid article { display: flex; min-height: 112px; align-items: center; gap: 15px; padding: 19px; background: white; border: 2px solid var(--line); border-radius: 24px; }
.steps-grid article > b { display: grid; flex: 0 0 42px; height: 42px; place-items: center; color: white; background: var(--green); border-radius: 14px; }
.steps-grid strong, .steps-grid small { display: block; }
.steps-grid strong { margin-bottom: 5px; font-size: 17px; }
.steps-grid small { color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.35; }
.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.level-card { display: flex; min-height: 385px; padding: 19px; text-align: left; background: white; border: 3px solid var(--line); border-radius: 29px; box-shadow: 0 10px 0 #ded6bc; flex-direction: column; }
.level-card.green { --card: var(--green); }
.level-card.gold { --card: var(--gold); }
.level-card.purple { --card: var(--purple); }
.level-top { display: flex; align-items: center; justify-content: space-between; }
.level-top > b { display: grid; width: 45px; height: 45px; place-items: center; color: white; background: var(--card); border-radius: 15px; }
.level-top small { color: var(--card); font-weight: 900; }
.level-art { position: relative; display: grid; height: 140px; place-items: center; margin: 14px 0; background: color-mix(in srgb, var(--card) 16%, white); border-radius: 22px; }
.level-art img { width: 130px; height: 130px; object-fit: contain; }
.level-art i { position: absolute; top: 10px; right: 10px; display: grid; min-width: 46px; height: 43px; place-items: center; padding: 0 8px; color: white; font-size: 22px; font-weight: 900; background: var(--card); border-radius: 14px; font-style: normal; }
.level-copy { flex: 1; }
.level-copy small, .level-copy strong, .level-copy span { display: block; }
.level-copy small { color: var(--card); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.level-copy strong { margin: 7px 0; font-size: 22px; }
.level-copy span { color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.4; }
.level-go { display: flex; min-height: 48px; align-items: center; justify-content: space-between; margin-top: 14px; padding: 0 15px; color: white; font-weight: 900; background: var(--card); border-radius: 15px; }
.animal-note { gap: 22px; margin: 28px auto 0; padding: 17px 27px; background: #e9f2e6; border: 2px solid #b9d1b7; border-radius: 28px; }
.animal-note img { width: 88px; height: 88px; object-fit: contain; }
.animal-note strong, .animal-note span { display: block; }
.animal-note strong { margin-bottom: 5px; font-size: 18px; }
.animal-note span { color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.4; }
.game-shell { padding: clamp(22px, 3.5vw, 39px); background: var(--paper); border: 3px solid var(--line); border-radius: 40px; box-shadow: var(--shadow); }
.game-head { justify-content: space-between; gap: 24px; }
.game-head h1 { margin-bottom: 7px; font-size: clamp(37px, 5vw, 54px); letter-spacing: -.045em; line-height: 1; }
.game-head > div:first-child > p:last-child { margin: 0; color: var(--muted); font-weight: 900; }
.round-badge { display: grid; flex: 0 0 82px; height: 82px; place-items: center; align-content: center; color: white; background: var(--accent); border: 7px solid color-mix(in srgb, var(--accent) 24%, white); border-radius: 50%; }
.round-badge strong { font-size: 25px; line-height: 1; }
.round-badge span { font-size: 10px; font-weight: 900; }
.progress-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 25px 0 18px; }
.progress-dots span { height: 8px; background: #e8e3d4; border-radius: 8px; }
.progress-dots .done { background: var(--green); }
.progress-dots .current { background: var(--accent); }
.word-workspace { display: grid; align-items: start; grid-template-columns: minmax(290px, .75fr) minmax(500px, 1.25fr); gap: 18px; }
.source-panel, .builder-panel { min-width: 0; min-height: 535px; padding: 23px; border: 3px solid var(--line); border-radius: 28px; }
.source-panel { text-align: center; background: #f2f0df; border-color: #d7cda8; }
.animal-scene { position: relative; display: grid; height: 260px; place-items: center; margin-bottom: 20px; overflow: hidden; background: radial-gradient(circle, #fff7ce 0 34%, #dcebd8 35% 68%, #b8d5bf 69%); border-radius: 28px; }
.animal-scene img { width: 220px; height: 220px; object-fit: contain; }
.animal-scene span { position: absolute; top: 19px; right: 21px; display: grid; width: 52px; height: 52px; place-items: center; color: white; font-family: Georgia, serif; font-size: 18px; font-weight: 900; background: var(--accent); border-radius: 16px; transform: rotate(5deg); }
.panel-label { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.source-word { display: block; overflow-wrap: anywhere; font-size: clamp(28px, 3.5vw, 42px); letter-spacing: .06em; line-height: 1.1; }
.source-panel > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.builder-panel { background: #fffaf0; border-color: #e3d6ad; }
.builder-head { justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.builder-head h2 { margin: 0; font-size: 27px; }
.letter-bank { display: flex; min-height: 76px; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 11px; background: #f0ead8; border: 2px dashed #c8b98f; border-radius: 21px; }
.letter-tile { display: grid; width: 52px; min-width: 52px; height: 58px; place-items: center; padding: 0; color: #385a54; font-size: 24px; font-weight: 900; background: white; border: 3px solid #7ca28f; border-radius: 15px; box-shadow: 0 5px 0 #b9cabc; }
.letter-tile:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 7px 0 #b9cabc; }
.letter-tile.used { opacity: .28; box-shadow: none; transform: translateY(4px); }
.current-word { display: grid; min-height: 70px; place-items: center; margin: 15px 0 11px; padding: 10px 15px; color: var(--ink); font-size: clamp(25px, 3.5vw, 38px); font-weight: 900; letter-spacing: .1em; background: white; border: 3px solid var(--accent); border-radius: 19px; overflow-wrap: anywhere; }
.current-word.empty { color: #9a9b8e; font-size: 16px; letter-spacing: 0; border-color: #d6ceb7; border-style: dashed; }
.builder-actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 9px; }
.tool-button { padding: 0 10px; font-size: 13px; }
.tool-button:disabled { opacity: .5; }
.check-button { padding: 0 13px; box-shadow: 0 6px 0 #2e795e; }
.word-slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 18px; }
.found-word, .empty-word { display: flex; min-height: 47px; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 15px; font-weight: 900; }
.found-word { color: #2f7658; background: #e6f3e8; border: 2px solid #9fc6aa; }
.found-word b, .empty-word b { display: grid; flex: 0 0 30px; height: 30px; place-items: center; color: white; background: var(--green); border-radius: 9px; }
.empty-word { color: #969280; background: #f3f0e5; border: 2px dashed #d3cbb5; }
.empty-word b { background: #b9b29e; }
.feedback { min-height: 82px; gap: 12px; margin-top: 16px; padding: 12px 14px; background: #eef4eb; border: 2px solid #c7d7c2; border-radius: 19px; }
.feedback > span { display: grid; flex: 0 0 43px; height: 43px; place-items: center; background: white; border-radius: 13px; }
.feedback p { flex: 1; margin: 0; }
.feedback strong, .feedback small { display: block; }
.feedback small { margin-top: 2px; color: var(--muted); font-weight: 800; line-height: 1.35; }
.feedback.retry { background: #fff0ec; border-color: #e2a299; }
.feedback.success { background: #e8f4e9; border-color: #9fc5a8; }
.feedback.hint { background: #fff5d9; border-color: #dbc36e; }
.feedback .primary-button { margin-left: auto; }
.result-card { max-width: 900px; margin: 35px auto; padding: clamp(28px, 4.5vw, 50px); text-align: center; background: var(--paper); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.result-art { position: relative; width: 155px; height: 140px; margin: auto; }
.result-art img { width: 150px; height: 150px; object-fit: contain; }
.result-art span { position: absolute; top: 0; right: -10px; display: grid; width: 48px; height: 48px; place-items: center; color: white; font-family: Georgia, serif; font-weight: 900; background: var(--purple); border-radius: 15px; transform: rotate(6deg); }
.result-card h1 { margin-bottom: 12px; font-size: clamp(39px, 5vw, 56px); letter-spacing: -.045em; }
.result-card > p:not(.eyebrow) { color: var(--muted); font-weight: 800; }
.result-stars { margin: 16px 0; color: var(--gold); font-size: 36px; letter-spacing: 5px; }
.result-stars span { color: #ddd6c1; }
.word-book { display: grid; gap: 8px; text-align: left; }
.word-book article { display: grid; align-items: center; grid-template-columns: 38px 1fr; gap: 12px; padding: 11px 14px; background: #f4f2e7; border-radius: 16px; }
.word-book article > b { display: grid; width: 36px; height: 36px; place-items: center; color: white; background: var(--green); border-radius: 11px; }
.word-book article strong { font-size: 13px; letter-spacing: .06em; }
.word-book p { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 0; }
.word-book p span { padding: 4px 8px; color: #3d765f; font-size: 12px; font-weight: 900; background: #e3efe5; border-radius: 8px; }
.result-stats, .result-actions { display: flex; justify-content: center; gap: 13px; }
.result-stats { margin: 22px 0; }
.result-stats > span { min-width: 125px; padding: 12px; background: #f0f4eb; border-radius: 17px; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { font-size: 25px; }
.result-stats small { color: var(--muted); font-weight: 800; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-copy > p, .hero h1 { margin-right: auto; margin-left: auto; }
  .hero-facts { justify-content: center; }
  .hero-art { width: min(100%, 520px); margin: auto; }
  .steps-grid, .levels-grid { grid-template-columns: 1fr; }
  .word-workspace { grid-template-columns: 1fr; }
  .source-panel, .builder-panel { min-height: 0; }
  .source-panel { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 13px; text-align: left; }
  .animal-scene { height: 180px; grid-row: 1 / 4; margin: 0; }
  .animal-scene img { width: 160px; height: 160px; }
}

@media (max-width: 700px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 10px; }
  .topbar { min-height: 58px; margin-bottom: 10px; }
  .brand-mark { width: 48px; height: 48px; font-size: 16px; border-radius: 16px; }
  .brand strong { font-size: 18px; }
  .brand small, .sound-button span:last-child, .letter-sparkles { display: none; }
  .sound-button { width: 48px; padding: 0; justify-content: center; }
  .hero { min-height: 0; gap: 24px; padding: 34px 20px; border-radius: 31px; }
  .hero h1 { font-size: clamp(38px, 11.3vw, 54px); }
  .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .hero-facts { gap: 8px; }
  .hero-facts span { padding: 8px 9px; background: #f5f3e9; border-radius: 12px; }
  .hero-art { min-height: 325px; }
  .hero-board { height: 320px; }
  .hero-source { top: 35px; left: 15px; width: 195px; }
  .hero-board img { width: 145px; height: 145px; }
  .word-one { top: 137px; left: 25px; }
  .word-two { top: 204px; left: 68px; }
  .pencil { right: 17px; font-size: 38px; }
  .how-section, .levels-section { margin-top: 18px; padding: 24px 15px; border-radius: 28px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .section-heading > p { text-align: left; }
  .animal-note { align-items: flex-start; padding: 15px; }
  .animal-note img { width: 70px; height: 70px; }
  .game-shell { padding: 21px 12px; border-radius: 29px; }
  .game-head { align-items: flex-start; }
  .game-head h1 { font-size: 34px; }
  .round-badge { flex-basis: 64px; height: 64px; border-width: 5px; }
  .source-panel, .builder-panel { padding: 16px; border-radius: 23px; }
  .source-panel { grid-template-columns: 125px 1fr; }
  .animal-scene { height: 135px; border-radius: 21px; }
  .animal-scene img { width: 125px; height: 125px; }
  .animal-scene span { top: 9px; right: 9px; width: 41px; height: 41px; font-size: 14px; }
  .source-word { font-size: clamp(25px, 8.2vw, 34px); }
  .builder-head { align-items: flex-start; flex-direction: column; }
  .hint-button { width: 100%; }
  .letter-bank { gap: 6px; padding: 9px 6px; }
  .letter-tile { width: 45px; min-width: 45px; height: 50px; font-size: 21px; border-radius: 13px; }
  .builder-actions { grid-template-columns: 1fr 1fr; }
  .check-button { grid-column: 1 / -1; }
  .feedback { align-items: flex-start; flex-wrap: wrap; }
  .feedback .primary-button { width: 100%; margin-left: 0; }
  .result-card { margin: 22px auto; padding: 28px 14px; border-radius: 29px; }
  .result-stats { flex-wrap: wrap; }
  .result-stats > span { min-width: 95px; flex: 1; }
  .result-actions { flex-direction: column-reverse; }
}

@media (max-width: 420px) {
  .brand { gap: 8px; }
  .brand strong { font-size: 17px; }
  .source-panel { display: block; text-align: center; }
  .animal-scene { height: 155px; margin-bottom: 14px; }
  .word-slots { grid-template-columns: 1fr; }
  .letter-tile { width: 44px; min-width: 44px; height: 48px; }
}

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