:root {
  --ink: #294f4b;
  --muted: #6a817c;
  --paper: #fffdf7;
  --line: #ddd5b9;
  --green: #3e9f78;
  --gold: #f0b943;
  --coral: #ef7468;
  --blue: #62acd6;
  --purple: #8e75c0;
  --shadow: 0 25px 55px rgba(57, 81, 73, .13);
  --soft-shadow: 0 13px 27px rgba(57, 81, 73, .1);
  color: var(--ink);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  background: #f7f8ef;
}

* { box-sizing: border-box; }
html { min-width: 0; overflow-x: hidden; scroll-behavior: smooth; }
body { min-width: 0; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 6% 10%, rgba(249, 221, 127, .34) 0 108px, transparent 110px), radial-gradient(circle at 95% 14%, rgba(147, 202, 222, .29) 0 140px, transparent 142px), linear-gradient(135deg, #f6faef, #fff9ed 47%, #f3f0fb); }
body::before { position: fixed; z-index: -1; inset: 0; content: ""; opacity: .18; background-image: radial-gradient(#6f9b8e 1px, transparent 1px); background-size: 27px 27px; }
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(241, 185, 67, .72); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }

.app { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 22px 0 50px; }
.loading-card { display: grid; width: min(410px, 100%); min-height: 250px; margin: 20vh auto 0; place-items: center; align-content: center; gap: 10px; text-align: center; background: var(--paper); border: 3px solid var(--line); border-radius: 37px; box-shadow: var(--shadow); }
.loading-card span { font-size: 64px; animation: float 1.5s ease-in-out infinite alternate; }
.loading-card p { margin: 0; font-size: 19px; font-weight: 900; }

.topbar, .topbar-actions, .brand, .brand-mark, .collection-button, .sound-button,
.section-heading, .level-top, .level-footer, .game-heading, .mission-strip,
.repair-heading, .tool-buttons, .swap-guide, .reading-strip, .feedback-card,
.result-actions, .result-stats, .result-book, .logic-note { display: flex; align-items: center; }
.topbar { position: relative; z-index: 30; min-height: 66px; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { min-width: 0; gap: 12px; padding: 0; text-align: left; background: none; border: 0; }
.brand-mark { flex: 0 0 auto; width: 78px; height: 58px; justify-content: center; padding: 4px; background: #fff7d7; border: 3px solid #dfd2a8; border-radius: 19px; box-shadow: 0 7px 16px rgba(67, 87, 78, .12); transform: rotate(-3deg); }
.brand-mark i, .brand-mark b { display: grid; width: 31px; height: 36px; place-items: center; color: #fff; font-size: 9px; font-style: normal; font-weight: 1000; border: 2px solid rgba(48, 70, 66, .25); border-radius: 9px; box-shadow: 0 4px 0 rgba(41, 79, 75, .25); }
.brand-mark i { background: var(--coral); transform: rotate(-5deg); }
.brand-mark b { margin-left: -4px; background: var(--blue); transform: rotate(5deg); }
.brand-mark em { margin-left: 1px; color: #c18d20; font-size: 15px; font-style: normal; font-weight: 1000; }
.brand strong, .brand small, .collection-button strong, .collection-button small { display: block; }
.brand strong { overflow: hidden; font-size: 23px; font-weight: 1000; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.topbar-actions { flex: 0 0 auto; gap: 8px; }
.top-spark { color: var(--gold); font-size: 27px; animation: twinkle 2s ease-in-out infinite; }
.collection-button, .sound-button, .back-button { min-height: 49px; color: var(--ink); font-weight: 900; background: rgba(255, 253, 247, .94); border: 2px solid var(--line); border-radius: 17px; box-shadow: 0 7px 16px rgba(65, 83, 76, .08); }
.collection-button { gap: 8px; padding: 5px 12px; text-align: left; }
.collection-button strong { font-size: 12px; }
.collection-button small { color: var(--muted); font-size: 9px; }
.sound-button { gap: 7px; padding: 0 13px; font-size: 11px; }
.back-button { width: 49px; padding: 0; font-size: 24px; }

.primary-button, .secondary-button, .hint-button, .reset-button, .check-button { min-height: 50px; padding: 0 20px; font-weight: 1000; border-radius: 16px; transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease; }
.primary-button, .check-button { color: #fff; background: var(--green); border: 0; box-shadow: 0 7px 0 #2d7d5e, 0 14px 22px rgba(49, 123, 91, .2); }
.secondary-button, .reset-button { color: var(--ink); background: #fffdf8; border: 2px solid var(--line); box-shadow: 0 6px 0 #d7d0b6; }
.hint-button { color: #775b15; background: #fff1b8; border: 2px solid #e4bc45; box-shadow: 0 5px 0 #d4a72e; }
.primary-button:not(:disabled):hover, .secondary-button:not(:disabled):hover, .hint-button:not(:disabled):hover, .reset-button:not(:disabled):hover, .check-button:not(:disabled):hover { filter: brightness(1.02); transform: translateY(-2px); }
.primary-button:not(:disabled):active, .secondary-button:not(:disabled):active, .hint-button:not(:disabled):active, .reset-button:not(:disabled):active, .check-button:not(:disabled):active { box-shadow: none; transform: translateY(5px); }
.compact { min-height: 45px; padding-inline: 17px; font-size: 12px; }

.eyebrow { margin: 0 0 10px; color: #347964; font-family: Georgia, serif; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.hero { position: relative; display: grid; min-height: 430px; grid-template-columns: .98fr 1.02fr; overflow: hidden; padding: 45px 48px; background: linear-gradient(125deg, #fffaf0, #eff9ef 54%, #f2edff); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.hero::before { position: absolute; width: 210px; height: 210px; top: -83px; left: 43%; content: ""; background: rgba(246, 194, 82, .18); border-radius: 50%; }
.hero-copy { position: relative; z-index: 4; align-self: center; }
.hero h1 { max-width: 530px; margin: 0 0 19px; font-size: 52px; font-weight: 1000; line-height: .98; letter-spacing: -.045em; }
.hero-copy > p:not(.eyebrow) { max-width: 470px; margin-bottom: 26px; color: var(--muted); font-size: 16px; font-weight: 800; line-height: 1.55; }
.hero-scene { position: relative; min-width: 0; }
.hero-board { position: absolute; inset: 18px -7px 12px 18px; overflow: hidden; background: #fffdfa; border: 8px solid #fff; border-radius: 38px; box-shadow: 0 20px 32px rgba(47, 67, 61, .17); transform: rotate(1.1deg); }
.hero-board::before { position: absolute; inset: 0; content: ""; opacity: .2; background-image: linear-gradient(#8dbbac 1px, transparent 1px), linear-gradient(90deg, #8dbbac 1px, transparent 1px); background-size: 27px 27px; }
.hero-picture { position: absolute; z-index: 3; top: 31px; left: 25px; display: grid; width: 124px; min-height: 117px; place-items: center; align-content: center; background: #fff; border: 4px solid #dcd4bd; border-radius: 28px; box-shadow: 0 11px 18px rgba(48, 69, 63, .13); transform: rotate(-4deg); }
.hero-picture span { font-size: 57px; }
.hero-picture small { color: var(--muted); font-size: 8px; font-weight: 900; }
.hero-wrong, .hero-right { position: absolute; z-index: 4; display: flex; gap: 7px; padding-bottom: 31px; }
.hero-wrong { left: 26px; bottom: 38px; }
.hero-right { right: 24px; top: 56px; }
.hero-wrong i, .hero-right i { display: grid; min-width: 70px; height: 68px; place-items: center; padding: 0 7px 2px; color: #fff; font-size: 21px; font-style: normal; font-weight: 1000; background: var(--coral); border: 4px solid #d45d55; border-radius: 21px 13px 21px 13px; box-shadow: 0 8px 0 #ae4c46; transform: rotate(-7deg); }
.hero-wrong i:nth-child(2) { background: var(--blue); border-color: #4b91b7; box-shadow: 0 8px 0 #397a9c; transform: rotate(6deg); }
.hero-right i { background: var(--green); border-color: #338261; box-shadow: 0 8px 0 #286b50; transform: none; }
.hero-right i:nth-child(2) { background: #e8b442; border-color: #cc9327; box-shadow: 0 8px 0 #ad791d; }
.hero-wrong b, .hero-right b { position: absolute; right: 0; bottom: 0; left: 0; color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; }
.hero-swap { position: absolute; z-index: 5; left: 53%; top: 51%; color: #dfa62f; font-size: 49px; font-weight: 1000; transform: translate(-50%, -50%) rotate(-10deg); }
.hero-check { position: absolute; z-index: 5; right: 16px; top: 31px; display: grid; width: 43px; height: 43px; place-items: center; padding-bottom: 2px; color: #fff; font-size: 25px; font-weight: 1000; background: var(--green); border: 4px solid #fff; border-radius: 50%; animation: pop 2.1s ease-in-out infinite; }

.how-section, .levels-section, .collection-section { margin-top: 48px; }
.section-heading { justify-content: space-between; gap: 24px; margin-bottom: 19px; }
.section-heading h2 { margin: 0; font-size: 39px; font-weight: 1000; letter-spacing: -.035em; }
.section-heading > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.45; text-align: right; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.step-card { display: flex; min-height: 112px; align-items: center; gap: 15px; padding: 18px; background: rgba(255, 253, 247, .9); border: 2px solid var(--line); border-radius: 24px; box-shadow: var(--soft-shadow); }
.step-number { display: grid; flex: 0 0 auto; width: 59px; height: 59px; place-items: center; padding-bottom: 2px; color: #fff; font-family: Georgia, serif; font-size: 27px; font-weight: 900; line-height: 1; background: #61bb8d; border: 8px solid #dbf3e6; border-radius: 50%; }
.step-card:nth-child(2) .step-number { background: #f3b943; border-color: #fff0bd; }
.step-card:nth-child(3) .step-number { background: #ed766d; border-color: #ffe0dd; }
.step-card strong, .step-card small { display: block; }
.step-card strong { margin-bottom: 6px; font-size: 17px; font-weight: 1000; }
.step-card small { color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1.35; }

.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.level-card { position: relative; display: flex; min-width: 0; min-height: 340px; flex-direction: column; padding: 19px; overflow: hidden; text-align: left; background: rgba(255, 253, 247, .94); border: 3px solid color-mix(in srgb, var(--accent) 50%, #ddd5b9); border-radius: 27px; box-shadow: var(--soft-shadow); transition: transform 170ms ease, box-shadow 170ms ease; }
.level-card::before { position: absolute; width: 140px; height: 140px; right: -62px; bottom: -60px; content: ""; opacity: .12; background: var(--accent); border-radius: 50%; }
.level-card:hover { transform: translateY(-5px) rotate(-.3deg); box-shadow: var(--shadow); }
.level-top, .level-footer { position: relative; z-index: 2; justify-content: space-between; }
.level-icon { display: grid; width: 49px; height: 49px; place-items: center; font-size: 24px; background: color-mix(in srgb, var(--accent) 17%, white); border-radius: 15px; }
.level-best { color: #d79a28; font-size: 13px; font-weight: 1000; }
.level-preview { position: relative; display: flex; min-height: 82px; align-items: center; justify-content: center; margin: 13px 0 9px; padding-right: 21px; }
.level-preview i { display: grid; min-width: 62px; height: 62px; place-items: center; margin-left: -5px; padding: 0 6px 2px; color: #fff; font-size: 18px; font-style: normal; font-weight: 1000; background: color-mix(in srgb, var(--accent) 83%, white); border: 3px solid color-mix(in srgb, var(--accent) 74%, #555); border-radius: 19px 12px 19px 12px; box-shadow: 0 7px 0 color-mix(in srgb, var(--accent) 70%, #444); transform: rotate(-3deg); }
.level-preview i:nth-child(even) { transform: rotate(3deg) translateY(-2px); }
.level-preview.count-4 i, .level-preview.count-5 i { min-width: 49px; font-size: 14px; }
.level-preview b { position: absolute; right: 2px; color: var(--accent); font-size: 27px; }
.level-copy { position: relative; z-index: 2; flex: 1; }
.level-copy small, .level-copy strong, .level-copy span { display: block; }
.level-copy small { margin-bottom: 7px; color: var(--accent); font-family: Georgia, serif; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.level-copy strong { margin-bottom: 7px; font-size: 22px; font-weight: 1000; }
.level-copy span { color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1.42; }
.level-footer { margin-top: 17px; color: var(--muted); font-size: 9px; font-weight: 900; }
.level-footer b { color: var(--accent); }

.collection-section { padding: 30px; background: rgba(255, 253, 247, .89); border: 3px solid var(--line); border-radius: 34px; box-shadow: var(--soft-shadow); }
.collection-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.word-page { position: relative; display: grid; min-width: 0; min-height: 158px; place-items: center; align-content: center; padding: 14px 7px 10px; overflow: hidden; text-align: center; background: linear-gradient(145deg, #f4f4f3, #ececed); border: 2px solid #d8d7d2; border-radius: 10px 22px 22px 10px; box-shadow: inset 8px 0 rgba(55, 77, 71, .04); }
.word-page::after { position: absolute; top: 12px; bottom: 12px; left: 7px; width: 3px; content: ""; background: #d3d1c9; border-radius: 6px; }
.word-page.opened { background: linear-gradient(145deg, #fffdf8, color-mix(in srgb, var(--word-color) 16%, white)); border-color: color-mix(in srgb, var(--word-color) 62%, #b5b09e); }
.word-page.opened::after { background: color-mix(in srgb, var(--word-color) 70%, #a49d88); }
.page-number { position: absolute; top: 8px; left: 13px; display: grid; width: 25px; height: 25px; place-items: center; padding-bottom: 1px; color: #77766f; font-family: Georgia, serif; font-size: 10px; font-weight: 900; line-height: 1; background: #fff; border: 2px solid #d7d3c6; border-radius: 50%; }
.page-picture { font-size: 42px; line-height: 1.1; filter: grayscale(.75); opacity: .55; }
.word-page.opened .page-picture { filter: none; opacity: 1; }
.word-page strong { overflow: hidden; max-width: 100%; margin-top: 7px; font-size: 16px; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.word-page small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 900; }
.logic-note { gap: 17px; margin-top: 20px; padding: 18px 22px; background: #edf6ff; border: 2px solid #a9cfe2; border-radius: 23px; }
.logic-note > span { display: grid; flex: 0 0 auto; width: 55px; height: 50px; place-items: center; font-size: 28px; background: #cfe9f7; border-radius: 14px; }
.logic-note p { margin: 0; color: #516a73; font-size: 11px; font-weight: 800; line-height: 1.45; }
.logic-note strong { display: block; margin-bottom: 3px; color: #3e5862; font-size: 13px; }

.game-shell { padding: 28px; background: rgba(255, 253, 247, .94); border: 3px solid var(--line); border-radius: 38px; box-shadow: var(--shadow); }
.game-heading { justify-content: space-between; gap: 20px; padding: 0 5px 17px; }
.game-heading .eyebrow { color: var(--level-accent); }
.game-heading h1 { margin: 0 0 6px; font-size: 42px; font-weight: 1000; letter-spacing: -.035em; }
.game-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 12px; font-weight: 900; }
.round-badge { display: grid; flex: 0 0 auto; width: 76px; height: 76px; place-items: center; align-content: center; color: #fff; background: var(--level-accent); border: 9px solid color-mix(in srgb, var(--level-accent) 25%, white); border-radius: 50%; }
.round-badge strong { font-family: Georgia, serif; font-size: 27px; line-height: .95; transform: translateY(-1px); }
.round-badge span { font-size: 8px; font-weight: 1000; }
.mission-strip { min-height: 44px; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 8px 13px; background: #f2f1ec; border-radius: 16px; }
.progress-dots { display: flex; flex: 1; gap: 6px; }
.progress-dot { flex: 1; height: 8px; background: #d4d2c8; border-radius: 99px; }
.progress-dot.done { background: #61b989; }
.progress-dot.current { background: var(--level-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--level-accent) 17%, transparent); }
.mission-strip > span { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 900; }
.repair-board { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; padding: 20px; background: #fbfaf5; border: 3px solid var(--line); border-radius: 30px; }
.panel-label { margin: 0 0 11px; color: #347964; font-family: Georgia, serif; font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.picture-panel { min-width: 0; text-align: center; }
.picture-frame { position: relative; display: grid; min-height: 330px; place-items: center; overflow: hidden; background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--picture-color) 16%, white)); border: 4px solid color-mix(in srgb, var(--picture-color) 57%, #cec5ad); border-radius: 31px; box-shadow: 0 9px 0 color-mix(in srgb, var(--picture-color) 37%, #b6ad99), 0 18px 25px rgba(50, 70, 64, .11); }
.picture-frame::before { position: absolute; width: 190px; height: 190px; content: ""; background: rgba(255, 255, 255, .52); border-radius: 50%; }
.picture-frame > span { position: relative; z-index: 3; font-size: 124px; line-height: 1; filter: drop-shadow(0 13px 9px rgba(44, 65, 59, .13)); animation: pictureFloat 2.4s ease-in-out infinite alternate; }
.picture-frame i, .picture-frame b { position: absolute; display: block; border-radius: 50%; }
.picture-frame i { width: 45px; height: 45px; top: 23px; right: 23px; border: 8px solid rgba(255, 255, 255, .72); }
.picture-frame b { width: 28px; height: 28px; bottom: 28px; left: 24px; background: color-mix(in srgb, var(--picture-color) 45%, white); }
.picture-panel > p:not(.panel-label) { margin: 21px 0 4px; font-size: 20px; font-weight: 1000; }
.picture-panel > small { color: var(--muted); font-size: 10px; font-weight: 800; }
.repair-panel { min-width: 0; }
.repair-heading { justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.repair-heading .panel-label { margin-bottom: 3px; }
.repair-heading h2 { margin: 0; font-size: 25px; font-weight: 1000; }
.tool-buttons { flex: 0 0 auto; gap: 8px; }
.tool-buttons button { min-height: 45px; padding-inline: 13px; font-size: 10px; }
.sequence-track { display: grid; min-height: 139px; gap: 10px; align-items: stretch; padding: 14px; background: linear-gradient(180deg, #f3f1ea, #fffdf8); border: 3px solid #ddd7c7; border-radius: 25px; }
.sequence-track.count-2 { grid-template-columns: repeat(2, 1fr); }
.sequence-track.count-3 { grid-template-columns: repeat(3, 1fr); }
.sequence-track.count-4 { grid-template-columns: repeat(4, 1fr); }
.sequence-track.count-5 { grid-template-columns: repeat(5, 1fr); }
.sequence-place { position: relative; min-width: 0; min-height: 105px; border-radius: 20px 13px 20px 13px; transition: transform 150ms ease, box-shadow 150ms ease; }
.sequence-place.drag-over { box-shadow: 0 0 0 6px #ffe28a; transform: translateY(-5px); }
.sequence-place.selected { box-shadow: 0 0 0 7px #ffe69a; transform: translateY(-5px) rotate(-1deg); }
.sequence-place.hinted { box-shadow: 0 0 0 7px #ccefdc; }
.sequence-place.check-wrong { animation: shake .35s ease; }
.sequence-place.correct { animation: correctPop .45s ease both; }
.flip-tile { display: grid; width: 100%; height: 100%; min-height: 105px; place-items: center; align-content: center; padding: 12px 5px 5px; color: #fff; touch-action: none; background: var(--level-accent); border: 3px solid color-mix(in srgb, var(--level-accent) 72%, #4d635e); border-radius: 20px 13px 20px 13px; box-shadow: inset -9px -9px rgba(31, 63, 56, .1), 0 8px 0 color-mix(in srgb, var(--level-accent) 67%, #3f514d), 0 11px 15px rgba(47, 68, 62, .13); transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease; }
.flip-tile:not(:disabled):hover { transform: translateY(-3px) rotate(-1deg); }
.flip-tile.dragging { opacity: .32; }
.sequence-place.selected .flip-tile { color: #624b0d; background: #f5c653; border-color: #d4a32a; box-shadow: inset -9px -9px rgba(92, 66, 11, .08), 0 8px 0 #b98820; }
.sequence-place.hinted .flip-tile { background: var(--green); border-color: #337e61; box-shadow: inset -9px -9px rgba(29, 73, 53, .08), 0 8px 0 #28664d; }
.flip-tile strong { font-size: clamp(22px, 3vw, 35px); line-height: 1; white-space: nowrap; }
.flip-tile small { margin-top: 8px; font-size: 7px; font-weight: 900; opacity: .85; }
.position-number { position: absolute; z-index: 4; top: 6px; left: 6px; display: grid; width: 24px; height: 24px; place-items: center; padding-bottom: 1px; color: var(--ink); font-family: Georgia, serif; font-size: 10px; font-weight: 900; line-height: 1; background: #fff; border-radius: 50%; }
.swap-guide { min-height: 46px; justify-content: center; gap: 14px; color: var(--muted); font-size: 9px; font-weight: 900; }
.swap-guide i { color: var(--level-accent); font-size: 29px; font-style: normal; }
.reading-strip { min-height: 63px; gap: 12px; margin-bottom: 15px; padding: 11px 14px; background: #f1f7f2; border: 2px solid #c3d9c9; border-radius: 18px; }
.reading-strip > span { font-size: 26px; }
.reading-strip p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.reading-strip strong { color: var(--ink); }
.check-button { width: 100%; }
.feedback-card { min-height: 89px; gap: 15px; margin-top: 17px; padding: 15px 18px; background: #eef8f2; border: 2px solid #9ed6b8; border-radius: 21px; }
.feedback-card > span { display: grid; flex: 0 0 auto; min-width: 43px; height: 43px; place-items: center; padding-bottom: 1px; color: #fff; font-size: 22px; font-weight: 1000; background: var(--green); border-radius: 13px; }
.feedback-card p { flex: 1; margin: 0; }
.feedback-card strong, .feedback-card small { display: block; }
.feedback-card strong { margin-bottom: 4px; font-size: 15px; font-weight: 1000; }
.feedback-card small { color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.4; }
.feedback-card.wrong { background: #fff1ef; border-color: #e8a09a; }
.feedback-card.wrong > span { background: var(--coral); }
.feedback-card.hint { background: #fff8dd; border-color: #e6c867; }
.feedback-card.hint > span { color: #785a14; background: #f3c851; }
.feedback-card.selected { background: #fff8dd; border-color: #e6c867; }
.feedback-card.selected > span { background: #e7b53e; }
.feedback-card.calm { background: #f2f6f2; border-color: #c8d5ca; }
.feedback-card.calm > span { background: #6e9b8d; }
.feedback-card.moving { background: #edf8f6; border-color: #9ed1c5; }

.tile-drag-ghost { position: fixed; z-index: 9999; top: 0; left: 0; display: grid; min-width: 86px; height: 82px; place-items: center; padding: 0 10px; pointer-events: none; color: #fff; font-size: 28px; font-weight: 1000; background: var(--purple); border: 4px solid #755ba8; border-radius: 20px 13px 20px 13px; box-shadow: 0 20px 35px rgba(39, 58, 53, .27); }

.result-card { position: relative; overflow: hidden; padding: 52px 70px; text-align: center; background: linear-gradient(145deg, #fffaf0, #eef9ee 55%, #f3edff); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.result-card::before, .result-card::after { position: absolute; width: 210px; height: 210px; content: ""; border-radius: 50%; }
.result-card::before { top: -110px; left: -60px; background: rgba(241, 185, 67, .2); }
.result-card::after { right: -75px; bottom: -105px; background: rgba(99, 173, 213, .18); }
.result-burst { position: relative; z-index: 2; display: grid; width: 92px; height: 92px; place-items: center; margin: 0 auto 17px; font-size: 48px; background: #fff; border: 4px solid #e5d9b6; border-radius: 30px; box-shadow: 0 10px 0 #d9c99c; animation: float 1.5s ease-in-out infinite alternate; }
.result-card .eyebrow, .result-card h1, .result-card > p, .result-stars, .result-stats, .result-book, .result-actions { position: relative; z-index: 2; }
.result-card h1 { margin: 0 0 12px; font-size: 55px; font-weight: 1000; letter-spacing: -.04em; }
.result-card > p:not(.eyebrow) { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 15px; font-weight: 800; line-height: 1.5; }
.result-stars { margin: 18px 0; color: #e7a72e; font-size: 41px; letter-spacing: 8px; }
.result-stats { width: min(700px, 100%); justify-content: center; margin: 0 auto 20px; overflow: hidden; background: rgba(255, 255, 255, .72); border: 2px solid var(--line); border-radius: 22px; }
.result-stats span { flex: 1; padding: 15px 9px; border-right: 1px solid #ddd6c3; }
.result-stats span:last-child { border-right: 0; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { font-size: 25px; font-weight: 1000; }
.result-stats small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 900; }
.result-book { width: min(620px, 100%); gap: 14px; margin: 0 auto 24px; padding: 14px 18px; text-align: left; background: #e8f8ef; border: 2px solid #a7d7bb; border-radius: 20px; }
.result-book > span { font-size: 33px; }
.result-book p { margin: 0; }
.result-book strong, .result-book small { display: block; }
.result-book strong { font-size: 14px; }
.result-book small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.result-actions { justify-content: center; gap: 13px; }

@keyframes float { to { transform: translateY(-8px) rotate(2deg); } }
@keyframes pictureFloat { to { transform: translateY(-7px) rotate(1deg); } }
@keyframes twinkle { 50% { opacity: .45; transform: scale(.8) rotate(20deg); } }
@keyframes pop { 50% { transform: scale(1.09) rotate(-5deg); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes correctPop { 50% { transform: scale(1.1) rotate(1deg); } }

@media (max-width: 900px) {
  .hero { min-height: 400px; padding: 38px 34px; }
  .hero h1 { font-size: 45px; }
  .hero-board { left: 4px; }
  .hero-picture { left: 15px; width: 108px; }
  .hero-wrong { left: 16px; }
  .hero-wrong i, .hero-right i { min-width: 60px; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 91px; }
  .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .repair-board { grid-template-columns: 250px minmax(0, 1fr); }
  .picture-frame { min-height: 300px; }
  .picture-frame > span { font-size: 108px; }
  .flip-tile strong { font-size: 26px; }
}

@media (max-width: 760px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 10px; }
  .topbar { align-items: flex-start; }
  .brand-mark { width: 61px; height: 50px; }
  .brand-mark i, .brand-mark b { width: 24px; height: 31px; font-size: 7px; }
  .brand-mark em { font-size: 12px; }
  .brand strong { font-size: 19px; }
  .brand small, .sound-button span:last-child, .top-spark { display: none; }
  .collection-button { padding-inline: 9px; }
  .collection-button strong { font-size: 10px; }
  .sound-button { width: 49px; padding: 0; justify-content: center; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 32px 24px 25px; }
  .hero h1 { font-size: clamp(38px, 10.5vw, 48px); }
  .hero-copy > p:not(.eyebrow) { font-size: 14px; }
  .hero-scene { min-height: 286px; margin-top: 17px; }
  .hero-board { inset: 5px 0; }
  .hero-picture { top: 23px; left: 20px; width: 108px; min-height: 102px; }
  .hero-picture span { font-size: 48px; }
  .hero-right { top: 46px; }
  .hero-wrong { bottom: 37px; }
  .section-heading { align-items: flex-end; }
  .section-heading h2 { font-size: 32px; }
  .section-heading > p { max-width: 210px; }
  .levels-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 278px; }
  .collection-section { padding: 22px 16px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-shell { padding: 17px 12px; border-radius: 28px; }
  .game-heading h1 { font-size: 34px; }
  .repair-board { grid-template-columns: 1fr; padding: 14px; }
  .picture-panel { display: grid; grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: auto auto auto; align-items: center; column-gap: 14px; text-align: left; }
  .picture-panel .panel-label { grid-column: 1 / -1; }
  .picture-frame { grid-row: 2 / 4; min-height: 125px; }
  .picture-frame::before { width: 95px; height: 95px; }
  .picture-frame > span { font-size: 72px; }
  .picture-panel > p:not(.panel-label) { margin: 0 0 5px; }
  .repair-heading { margin-top: 10px; }
  .sequence-track { min-height: 124px; }
  .sequence-place, .flip-tile { min-height: 94px; }
  .feedback-card { align-items: flex-start; }
  .feedback-card .primary-button { flex-basis: 100%; }
  .result-card { padding: 39px 18px; }
  .result-card h1 { font-size: 44px; }
}

@media (max-width: 520px) {
  .topbar { min-height: 57px; margin-bottom: 13px; gap: 7px; }
  .brand { gap: 7px; }
  .brand-mark { width: 48px; height: 43px; border-radius: 14px; }
  .brand-mark i, .brand-mark b { width: 19px; height: 27px; font-size: 6px; }
  .brand-mark em { font-size: 9px; }
  .brand strong { max-width: 151px; font-size: 16px; }
  .collection-button { min-height: 43px; }
  .collection-button > span:first-child { display: none; }
  .sound-button, .back-button { width: 43px; min-height: 43px; }
  .hero { padding-inline: 18px; border-radius: 31px; }
  .hero-scene { min-height: 255px; }
  .hero-board { border-width: 5px; border-radius: 28px; }
  .hero-picture { left: 12px; width: 90px; min-height: 86px; }
  .hero-picture span { font-size: 40px; }
  .hero-wrong { left: 13px; gap: 4px; }
  .hero-right { right: 13px; top: 37px; gap: 4px; }
  .hero-wrong i, .hero-right i { min-width: 44px; height: 56px; padding-inline: 3px; font-size: 16px; border-width: 3px; }
  .hero-swap { font-size: 36px; }
  .section-heading { display: block; }
  .section-heading > p { max-width: none; margin-top: 7px; text-align: left; }
  .step-card { gap: 10px; padding: 14px; }
  .step-number { width: 52px; height: 52px; font-size: 23px; border-width: 7px; }
  .level-preview.count-5 i { min-width: 43px; font-size: 12px; }
  .collection-grid { gap: 7px; }
  .word-page { min-height: 139px; }
  .page-picture { font-size: 36px; }
  .word-page strong { font-size: 13px; }
  .logic-note { display: block; }
  .logic-note > span { margin-bottom: 10px; }
  .game-heading h1 { font-size: 28px; }
  .round-badge { width: 64px; height: 64px; border-width: 7px; }
  .round-badge strong { font-size: 23px; }
  .mission-strip { display: block; }
  .mission-strip > span { display: block; margin-top: 9px; }
  .picture-panel { grid-template-columns: 100px minmax(0, 1fr); }
  .picture-frame > span { font-size: 62px; }
  .repair-heading { align-items: flex-end; }
  .repair-heading h2 { font-size: 20px; }
  .tool-buttons { gap: 5px; }
  .tool-buttons button { min-height: 40px; padding-inline: 8px; font-size: 8px; }
  .sequence-track { min-height: 102px; gap: 5px; padding: 8px; border-radius: 19px; }
  .sequence-place, .flip-tile { min-height: 82px; }
  .flip-tile { padding-inline: 2px; border-radius: 15px 9px 15px 9px; }
  .flip-tile strong { font-size: 21px; }
  .flip-tile small { font-size: 6px; }
  .position-number { width: 19px; height: 19px; top: 4px; left: 4px; font-size: 8px; }
  .swap-guide { gap: 7px; font-size: 7px; }
  .swap-guide i { font-size: 24px; }
  .reading-strip { padding: 9px 10px; }
  .reading-strip p { font-size: 9px; }
  .feedback-card { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .feedback-card > span { min-width: 37px; height: 37px; font-size: 19px; }
  .feedback-card p { width: calc(100% - 50px); }
  .feedback-card .primary-button { width: 100%; }
  .result-card h1 { font-size: 36px; }
  .result-stats { display: grid; grid-template-columns: repeat(2, 1fr); }
  .result-stats span { border-right: 0; border-bottom: 1px solid #ddd6c3; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
}

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