:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #2d504d;
  --muted: #70837e;
  --paper: #fffdf7;
  --line: #ddd6bc;
  --green: #58a97b;
  --gold: #efb84d;
  --coral: #e77967;
  --blue: #64a7cc;
  --purple: #8a77b2;
  --shadow: 0 18px 44px rgba(57, 78, 70, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #f4f8ed; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--ink); background: radial-gradient(circle at 8% 10%, rgba(239, 184, 77, .19) 0 130px, transparent 132px), radial-gradient(circle at 94% 28%, rgba(100, 167, 204, .13) 0 170px, transparent 172px), linear-gradient(145deg, #f3f8ed, #fffaf2 55%, #f2effa); }
body::before { position: fixed; inset: 0; z-index: -1; opacity: .14; background-image: radial-gradient(#709086 1.2px, transparent 1.2px); background-size: 28px 28px; content: ""; }
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(239, 184, 77, .75); outline-offset: 4px; }
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 { font-size: 64px; }
.loading-card p { color: var(--muted); font-weight: 900; }
.topbar, .brand, .top-actions, .section-heading, .game-head, .choice-head, .feedback-card, .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; font-size: 29px; background: #fff2c9; border: 3px solid #ddce9d; 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: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { gap: 10px; }
.top-pencil { color: var(--coral); font-size: 29px; }
.sound-button, .back-button { min-width: 48px; min-height: 48px; font-weight: 900; background: rgba(255, 253, 247, .94); 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: #3b7d64; font-family: Georgia, serif; font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.primary-button, .secondary-button, .hint-button { min-width: 44px; min-height: 52px; border-radius: 17px; font-weight: 900; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; color: white; background: #3e9875; border: 0; box-shadow: 0 8px 0 #2d795d; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 4px 0 #2d795d; }
.primary-button.compact { min-height: 46px; margin-left: auto; box-shadow: none; }
.secondary-button { padding: 0 21px; background: white; border: 2px solid var(--line); }
.hint-button { padding: 0 18px; background: #fff2c6; border: 2px solid #dfc66f; }

.hero { display: grid; min-height: 500px; align-items: center; grid-template-columns: 1.05fr .95fr; gap: 50px; padding: clamp(42px, 6vw, 70px); overflow: hidden; background: rgba(255, 253, 247, .97); border: 3px solid var(--line); border-radius: 46px; box-shadow: var(--shadow); }
.hero h1 { max-width: 590px; margin-bottom: 19px; font-size: clamp(47px, 5.6vw, 68px); font-weight: 900; letter-spacing: -.055em; line-height: .99; }
.hero-copy > p:not(.eyebrow) { max-width: 540px; margin-bottom: 27px; color: var(--muted); font-size: 18px; font-weight: 800; line-height: 1.52; }
.hero-facts { display: flex; gap: 9px; margin-top: 27px; }
.hero-facts span { padding: 9px 13px; color: var(--muted); font-size: 12px; font-weight: 900; background: #f4f5eb; border-radius: 13px; }
.hero-facts strong { color: var(--ink); font-size: 17px; }
.hero-art { position: relative; min-height: 365px; }
.hero-notebook { position: absolute; inset: 0 12px 24px 0; padding: 22px; background: #fffdf7; border: 5px solid #dcd4b8; border-radius: 32px; box-shadow: 0 20px 38px rgba(57, 75, 70, .18); transform: rotate(2deg); }
.hero-notebook > p { margin: 0 0 8px; color: #678078; font-family: Georgia, serif; font-size: 11px; font-weight: 900; letter-spacing: .15em; text-align: center; }
.hero-notebook .object-picture { display: block; width: 190px; height: 166px; margin: 0 auto; }
.paper-clip { position: absolute; top: -14px; left: 32px; width: 26px; height: 58px; border: 5px solid #80928c; border-radius: 15px; transform: rotate(7deg); }
.hero-tags { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hero-tags span { padding: 9px 5px; font-size: 11px; font-weight: 900; text-align: center; background: #edf4e8; border-radius: 12px; }
.hero-tags b { display: block; margin-bottom: 3px; font-size: 20px; }
.hero-animal { position: absolute; right: -24px; bottom: 0; z-index: 2; width: 145px; height: 145px; object-fit: contain; filter: drop-shadow(0 12px 12px rgba(57, 75, 70, .2)); }

.how-section, .levels-section { margin-top: 48px; }
.section-heading { justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(33px, 4vw, 46px); font-weight: 900; letter-spacing: -.035em; }
.section-heading > p { max-width: 440px; 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: 13px; }
.step-card { display: grid; min-height: 135px; align-items: center; grid-template-columns: 66px 1fr; gap: 14px; padding: 20px; background: var(--paper); border: 2px solid var(--line); border-radius: 25px; }
.step-number { display: grid; width: 62px; height: 62px; place-items: center; color: white; font-family: Georgia, serif; font-size: 29px; font-weight: 900; background: var(--green); border: 5px solid #d8efdf; border-radius: 50%; }
.step-card:nth-child(2) .step-number { background: var(--gold); border-color: #fff0bf; }
.step-card:nth-child(3) .step-number { background: var(--purple); border-color: #e7def7; }
.step-card strong, .step-card small { display: block; }
.step-card strong { margin-bottom: 6px; font-size: 18px; }
.step-card small { color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.level-card { min-width: 0; padding: 18px; text-align: left; background: var(--paper); border: 3px solid var(--line); border-radius: 29px; box-shadow: 0 8px 0 #d8d1b7; transition: transform .16s ease, border-color .16s ease; }
.level-card:hover { border-color: var(--level); transform: translateY(-3px); }
.level-card.green { --level: var(--green); }
.level-card.gold { --level: var(--gold); }
.level-card.purple { --level: var(--purple); }
.level-head, .level-go { display: flex; align-items: center; justify-content: space-between; }
.level-number { display: grid; width: 46px; height: 46px; place-items: center; color: white; font-family: Georgia, serif; font-weight: 900; background: var(--level); border-radius: 15px; }
.level-best { color: #aa7b20; font-size: 14px; font-weight: 900; }
.level-visual { position: relative; display: block; margin: 13px 0; padding: 8px; background: color-mix(in srgb, var(--level) 12%, white); border-radius: 21px; }
.level-visual .object-picture { display: block; width: 125px; height: 110px; margin: 0 auto; }
.mini-traits { position: absolute; right: 7px; bottom: 7px; display: flex; gap: 3px; }
.mini-traits i { display: grid; width: 29px; height: 29px; place-items: center; font-style: normal; background: white; border-radius: 9px; box-shadow: 0 3px 8px rgba(57, 75, 70, .12); }
.level-copy small, .level-copy strong, .level-copy span { display: block; }
.level-copy small { color: var(--level); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.level-copy strong { margin: 6px 0; font-size: 23px; }
.level-copy span { min-height: 42px; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.level-go { margin-top: 16px; color: var(--level); font-weight: 900; }
.animal-note { gap: 16px; margin-top: 32px; padding: 18px 22px; background: #eef4e8; border: 2px solid #ceddc7; border-radius: 25px; }
.animal-note img { width: 76px; height: 76px; object-fit: contain; }
.animal-note p { margin: 0; }
.animal-note strong, .animal-note span { display: block; }
.animal-note span { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.45; }

.game-shell { padding: clamp(24px, 4vw, 44px); background: var(--paper); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.game-head { justify-content: space-between; gap: 24px; }
.game-head h1 { margin-bottom: 8px; font-size: clamp(36px, 5vw, 54px); font-weight: 900; letter-spacing: -.045em; }
.game-head > div > p:last-child { margin: 0; color: var(--muted); font-weight: 800; }
.round-badge { display: grid; min-width: 82px; height: 82px; place-items: center; align-content: center; color: white; background: var(--accent); border: 6px solid color-mix(in srgb, var(--accent) 25%, white); border-radius: 50%; }
.round-badge strong { font-family: Georgia, serif; font-size: 29px; 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: 24px 0 18px; }
.progress-dots span { height: 7px; background: #e2ded0; border-radius: 999px; }
.progress-dots .done { background: var(--green); }
.progress-dots .current { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.trait-rail { display: flex; align-items: stretch; gap: 7px; margin-bottom: 18px; padding: 10px; background: #f4f4eb; border-radius: 22px; }
.trait-stop { display: flex; min-width: 0; flex: 1; align-items: center; gap: 8px; padding: 9px; color: #87958f; background: white; border: 2px solid #dedbcd; border-radius: 15px; }
.trait-stop > span { display: grid; min-width: 38px; height: 38px; place-items: center; font-size: 21px; background: #f4f4ee; border-radius: 11px; }
.trait-stop p { min-width: 0; margin: 0; }
.trait-stop small, .trait-stop strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trait-stop small { font-size: 9px; font-weight: 900; text-transform: uppercase; }
.trait-stop strong { margin-top: 2px; font-size: 12px; }
.trait-stop.current { color: var(--ink); border-color: var(--accent); }
.trait-stop.done { color: #36795c; background: #eaf5ec; border-color: #a9cfb4; }
.rail-arrow { align-self: center; color: #a9aaa0; font-style: normal; }
.workspace { display: grid; grid-template-columns: .78fr 1.22fr; gap: 17px; }
.object-panel, .choice-panel { padding: 20px; border-radius: 29px; }
.object-panel { position: relative; text-align: center; background: #eef5e9; border: 3px solid #cddfc6; }
.object-label { display: inline-block; padding: 6px 11px; color: #55766b; font-size: 11px; font-weight: 900; background: white; border-radius: 10px; text-transform: uppercase; }
.object-panel .object-picture { display: block; width: min(260px, 100%); height: auto; margin: 5px auto -2px; }
.object-panel h2 { margin: 0 0 13px; font-size: 29px; }
.sentence-preview { display: flex; align-items: flex-start; gap: 9px; padding: 12px; text-align: left; background: white; border: 2px dashed #c9c6b7; border-radius: 17px; }
.sentence-preview > span { font-size: 24px; }
.sentence-preview p { margin: 0; }
.sentence-preview small, .sentence-preview strong, .sentence-preview em { display: block; }
.sentence-preview small { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.sentence-preview strong { font-size: 13px; line-height: 1.45; }
.sentence-preview strong b { color: #397d62; }
.sentence-preview strong i { color: #b3aea0; }
.sentence-preview em { margin-top: 3px; color: #7d6baa; font-size: 12px; font-style: normal; font-weight: 900; }
.choice-panel { background: #fff9e9; border: 3px solid #ead9a5; }
.choice-head { justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.choice-head h2 { margin: 0; font-size: clamp(25px, 3vw, 33px); }
.trait-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trait-option { position: relative; display: grid; min-width: 0; min-height: 104px; place-items: center; align-content: center; gap: 5px; padding: 10px; text-align: center; background: white; border: 3px solid #ddd6bf; border-radius: 21px; box-shadow: 0 6px 0 #ddd6bf; }
.trait-option > span { font-size: 29px; }
.trait-option strong { font-size: 15px; line-height: 1.2; }
.trait-option small { position: absolute; top: 6px; right: 8px; color: #aaa38d; font-size: 10px; font-weight: 900; }
.trait-option:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.trait-option.is-wrong { color: #a55349; background: #fff0ed; border-color: var(--coral); box-shadow: none; }
.trait-option.is-correct { color: #327257; background: #eaf6ed; border-color: var(--green); box-shadow: none; }
.trait-option.is-hinted { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(239, 184, 77, .25); animation: pulse 1s ease infinite; }
.feedback-card { min-height: 84px; gap: 13px; margin-top: 17px; padding: 14px 16px; background: #f4f6f0; border: 2px solid #d8ded4; border-radius: 22px; }
.feedback-card > span { display: grid; min-width: 52px; height: 52px; place-items: center; font-size: 27px; background: white; border-radius: 16px; }
.feedback-card p { margin: 0; }
.feedback-card strong, .feedback-card small { display: block; }
.feedback-card small { margin-top: 4px; color: var(--muted); font-weight: 800; line-height: 1.35; }
.feedback-card.success { background: #eaf6ed; border-color: #a9d2b6; }
.feedback-card.retry { background: #fff1ed; border-color: #e7b4aa; }

.result-card { max-width: 830px; margin: 38px auto; padding: clamp(30px, 5vw, 55px); text-align: center; background: var(--paper); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.result-art { position: relative; width: 170px; height: 145px; margin: 0 auto 5px; }
.result-art img { width: 100%; height: 100%; object-fit: contain; }
.result-art span { position: absolute; right: 4px; bottom: 11px; display: grid; width: 49px; height: 49px; place-items: center; color: white; font-size: 26px; font-weight: 900; background: var(--green); border: 5px solid white; border-radius: 50%; }
.result-card h1 { margin-bottom: 13px; font-size: clamp(42px, 6vw, 64px); letter-spacing: -.05em; }
.result-card > p:not(.eyebrow) { color: var(--muted); font-size: 17px; font-weight: 800; }
.result-stars { margin: 20px 0; color: var(--gold); font-size: 42px; letter-spacing: 6px; }
.result-stars span { color: #dedbcf; }
.description-list { display: grid; gap: 8px; text-align: left; }
.description-list p { display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 14px; background: #f1f5eb; border-radius: 15px; }
.description-list b { display: grid; min-width: 32px; height: 32px; place-items: center; color: white; background: var(--green); border-radius: 10px; }
.description-list span { font-size: 13px; font-weight: 900; line-height: 1.35; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.result-stats span { padding: 14px; background: #f5f3e9; border-radius: 17px; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { font-family: Georgia, serif; font-size: 27px; }
.result-stats small { color: var(--muted); font-weight: 800; }
.result-actions { display: flex; justify-content: center; gap: 12px; }

@keyframes pulse { 50% { transform: translateY(-3px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 44px; }
  .hero-copy { text-align: center; }
  .hero-copy > p:not(.eyebrow), .hero h1 { margin-right: auto; margin-left: auto; }
  .hero-facts { justify-content: center; }
  .hero-art { width: min(540px, 100%); margin: 0 auto; }
  .steps-grid, .levels-grid { grid-template-columns: 1fr; }
  .level-card { display: grid; align-items: center; grid-template-columns: 150px 1fr; gap: 8px 18px; }
  .level-head { grid-column: 1 / -1; }
  .level-visual { grid-row: 2 / 4; margin: 0; }
  .level-go { margin-top: 6px; }
  .workspace { grid-template-columns: 1fr; }
  .object-panel { display: grid; align-items: center; grid-template-columns: 190px 1fr; gap: 0 12px; text-align: left; }
  .object-label { position: absolute; top: 14px; left: 14px; }
  .object-panel .object-picture { grid-row: 1 / 3; }
  .sentence-preview { grid-column: 2; }
}

@media (max-width: 700px) {
  .app { width: min(1120px, calc(100% - 20px)); padding-top: 10px; }
  .topbar { min-height: 54px; margin-bottom: 12px; }
  .brand-mark { width: 46px; height: 46px; font-size: 23px; border-radius: 15px; }
  .brand strong { font-size: 18px; }
  .brand small, .sound-button span:last-child, .top-pencil { display: none; }
  .sound-button { width: 48px; padding: 0; justify-content: center; }
  .hero { min-height: auto; padding: 34px 20px; border-radius: 31px; }
  .hero h1 { font-size: 42px; }
  .hero-art { min-height: 325px; }
  .how-section, .levels-section { margin-top: 36px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .section-heading > p { text-align: left; }
  .level-card { display: block; }
  .level-visual { margin: 13px 0; }
  .game-shell { padding: 20px 13px; border-radius: 29px; }
  .game-head { align-items: flex-start; }
  .game-head h1 { font-size: 34px; }
  .round-badge { min-width: 64px; height: 64px; border-width: 4px; }
  .trait-rail { overflow-x: auto; }
  .trait-stop { min-width: 126px; }
  .rail-arrow { min-width: 12px; }
  .object-panel { display: block; text-align: center; }
  .object-panel .object-picture { width: 190px; }
  .object-panel h2 { font-size: 25px; }
  .choice-panel { padding: 15px; }
  .choice-head { align-items: flex-start; flex-direction: column; }
  .hint-button { width: 100%; }
  .trait-options { grid-template-columns: 1fr; }
  .trait-option { display: flex; min-height: 67px; justify-content: flex-start; padding: 8px 14px; text-align: left; }
  .trait-option > span { min-width: 38px; text-align: center; }
  .feedback-card { align-items: flex-start; flex-wrap: wrap; }
  .feedback-card .primary-button { width: 100%; margin-left: 0; }
  .animal-note { align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-facts { flex-wrap: wrap; }
  .hero-notebook { inset-right: 0; padding: 19px 13px; }
  .hero-animal { right: -5px; width: 116px; height: 116px; }
  .hero-tags span { font-size: 10px; }
  .result-stats { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column; }
}

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