:root {
  --ink: #294f4b;
  --muted: #69817c;
  --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, .35) 0 105px, transparent 107px), radial-gradient(circle at 95% 14%, rgba(147, 202, 222, .29) 0 138px, transparent 140px), linear-gradient(135deg, #f6faef, #fff9ed 47%, #f3f0fb); }
body::before { position: fixed; z-index: -1; inset: 0; content: ""; opacity: .2; 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, .assembly-heading, .tool-buttons, .tray-heading, .feedback-card, .result-actions, .result-stats, .result-album { 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: 68px; height: 56px; justify-content: center; padding: 5px 4px; background: #fff7d7; border: 3px solid #dfd2a8; border-radius: 19px; box-shadow: 0 7px 16px rgba(67, 87, 78, .12); transform: rotate(-4deg); }
.brand-mark i, .brand-mark b, .brand-mark em { display: grid; width: 23px; height: 35px; place-items: center; margin-left: -3px; color: #fff; font-size: 15px; font-style: normal; font-weight: 1000; border-radius: 8px; }
.brand-mark i { margin-left: 0; background: var(--coral); transform: rotate(-5deg); }
.brand-mark b { background: var(--blue); transform: rotate(4deg); }
.brand-mark em { background: #f0b943; transform: rotate(-2deg); }
.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: .06em; 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 { 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 { 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 { 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 { 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: .94fr 1.06fr; 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: 520px; margin: 0 0 19px; font-size: 55px; font-weight: 1000; line-height: .98; letter-spacing: -.045em; }
.hero-copy > p:not(.eyebrow) { max-width: 480px; margin-bottom: 26px; color: var(--muted); font-size: 16px; font-weight: 800; line-height: 1.55; }
.hero-scene { position: relative; min-width: 0; }
.hero-desk { position: absolute; inset: 20px -8px 12px 20px; overflow: hidden; background: #fffdf9; border: 8px solid #fff; border-radius: 38px; box-shadow: 0 20px 32px rgba(47, 67, 61, .17); transform: rotate(1.4deg); }
.hero-desk::before { position: absolute; inset: 0; content: ""; opacity: .21; 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: 38px; left: 35px; display: grid; width: 135px; min-height: 120px; 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: 61px; }
.hero-picture small { color: var(--muted); font-size: 8px; font-weight: 900; }
.hero-letters, .hero-slots { position: absolute; z-index: 4; display: flex; gap: 8px; }
.hero-letters { right: 36px; top: 49px; }
.hero-slots { right: 36px; bottom: 44px; }
.hero-letters i, .hero-slots i { display: grid; width: 62px; height: 70px; place-items: center; color: #fff; font-size: 35px; font-style: normal; font-weight: 1000; background: var(--coral); border: 4px solid #d65d54; border-radius: 17px; box-shadow: 0 8px 0 #af4944; transform: rotate(-6deg); }
.hero-letters i:nth-child(2) { background: var(--blue); border-color: #4b91b7; box-shadow: 0 8px 0 #397a9c; transform: rotate(5deg); }
.hero-letters i:nth-child(3) { background: #f1ba43; border-color: #d69b29; box-shadow: 0 8px 0 #b88220; transform: rotate(-2deg); }
.hero-slots i { color: var(--ink); background: #fff; border-style: dashed; border-color: #b9b5a8; box-shadow: none; transform: none; }
.hero-arrow { position: absolute; z-index: 4; right: 125px; top: 143px; color: #e3a72e; font-size: 43px; font-weight: 1000; transform: rotate(90deg); }
.hero-check { position: absolute; z-index: 5; right: 21px; bottom: 87px; display: grid; width: 43px; height: 43px; place-items: center; 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-top: 1px; 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: 337px; 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 { display: flex; min-height: 78px; align-items: center; justify-content: center; margin: 14px 0 9px; }
.level-preview i { display: grid; width: 48px; height: 57px; place-items: center; margin-left: -5px; color: #fff; font-size: 28px; 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: 14px; box-shadow: 0 7px 0 color-mix(in srgb, var(--accent) 70%, #444); transform: translateY(calc((var(--n) - 2) * 1px)) rotate(calc((var(--n) - 2) * 2deg)); }
.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; }
.album-tile { position: relative; display: grid; min-width: 0; min-height: 147px; place-items: center; align-content: center; padding: 12px 7px 10px; overflow: hidden; text-align: center; background: linear-gradient(145deg, #f4f4f3, #ececed); border: 2px solid #d8d7d2; border-radius: 21px; }
.album-tile.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); }
.tile-number { position: absolute; top: 8px; left: 8px; display: grid; width: 24px; height: 24px; 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%; }
.album-picture { font-size: 39px; line-height: 1.1; filter: grayscale(.75); opacity: .55; }
.album-tile.opened .album-picture { filter: none; opacity: 1; }
.album-tile strong { overflow: hidden; max-width: 100%; margin-top: 5px; font-size: 16px; font-weight: 1000; text-overflow: ellipsis; white-space: nowrap; }
.album-tile small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 900; }
.play-note { display: flex; align-items: center; gap: 17px; margin-top: 20px; padding: 18px 22px; background: #f2ecff; border: 2px solid #c9bae9; border-radius: 23px; }
.play-note > span { display: grid; flex: 0 0 auto; width: 55px; height: 48px; place-items: center; color: #fff; font-size: 28px; font-weight: 1000; background: var(--purple); border-radius: 14px; }
.play-note p { margin: 0; color: #625c76; font-size: 11px; font-weight: 800; line-height: 1.45; }
.play-note strong { display: block; margin-bottom: 3px; color: #4a4261; 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; }
.puzzle-board { display: grid; grid-template-columns: 285px minmax(0, 1fr); gap: 18px; 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: 319px; 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: 180px; height: 180px; content: ""; background: rgba(255,255,255,.52); border-radius: 50%; }
.picture-frame > span { position: relative; z-index: 3; font-size: 120px; 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: 44px; height: 44px; top: 23px; right: 23px; background: rgba(255,255,255,.62); }
.picture-frame b { width: 25px; height: 25px; 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; }
.assembly-panel { min-width: 0; }
.assembly-heading { justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.assembly-heading .panel-label { margin-bottom: 3px; }
.assembly-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; }
.slots-row { display: grid; gap: 7px; min-height: 91px; align-items: stretch; padding: 10px; background: #f1f0e9; border: 2px solid #dad6c7; border-radius: 21px; }
.slots-row.count-3 { grid-template-columns: repeat(3, 1fr); }
.slots-row.count-4 { grid-template-columns: repeat(4, 1fr); }
.slots-row.count-5 { grid-template-columns: repeat(5, 1fr); }
.slots-row.count-6 { grid-template-columns: repeat(6, 1fr); }
.slots-row.count-7 { grid-template-columns: repeat(7, 1fr); }
.slots-row.count-8 { grid-template-columns: repeat(8, 1fr); }
.slots-row.count-9 { grid-template-columns: repeat(9, 1fr); }
.slots-row.count-10 { grid-template-columns: repeat(10, 1fr); }
.letter-slot { position: relative; display: grid; min-width: 0; min-height: 69px; place-items: center; background: rgba(255,255,255,.74); border: 3px dashed #c2beb0; border-radius: 16px; transition: transform 150ms ease, background 150ms ease; }
.letter-slot.drag-over { background: #fff3c8; border-color: #e4ad2b; transform: translateY(-4px); }
.letter-slot.filled { background: transparent; border-color: transparent; }
.letter-slot.check-wrong { animation: shake .35s ease; }
.letter-slot.correct { animation: correctPop .45s ease both; }
.slot-number { position: absolute; z-index: 5; top: 3px; left: 3px; display: grid; width: 19px; height: 19px; place-items: center; padding-bottom: 1px; color: #7c7a71; font-family: Georgia, serif; font-size: 8px; font-weight: 900; line-height: 1; background: #fff; border: 1px solid #d4d0c3; border-radius: 50%; }
.empty-mark { color: #c7c3b7; font-family: Georgia, serif; font-size: 26px; font-weight: 900; }
.letter-tile { position: relative; display: grid; min-width: 0; place-items: center; align-content: center; color: #fff; touch-action: none; background: var(--level-accent); border: 3px solid color-mix(in srgb, var(--level-accent) 72%, #4d635e); border-radius: 15px; box-shadow: 0 7px 0 color-mix(in srgb, var(--level-accent) 67%, #3f514d), 0 10px 14px rgba(47,68,62,.13); transition: transform 140ms ease, opacity 140ms ease; }
.letter-tile:not(:disabled):hover { transform: translateY(-3px) rotate(-1deg); }
.letter-tile.dragging { opacity: .32; }
.letter-tile strong { font-size: 34px; line-height: 1; }
.letter-tile small { margin-top: 5px; font-size: 7px; font-weight: 900; opacity: .85; }
.letter-tile.placed { width: 100%; height: 100%; border-radius: 13px; box-shadow: 0 5px 0 color-mix(in srgb, var(--level-accent) 67%, #3f514d); }
.tray-box { min-height: 218px; margin-top: 17px; padding: 17px; background: #fffdf8; border: 3px solid #ded7c1; border-radius: 25px; transition: background 150ms ease, border-color 150ms ease; }
.tray-box.drag-over { background: #fff6d7; border-color: #e4b84c; }
.tray-heading { justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.tray-heading span { font-size: 14px; font-weight: 1000; }
.tray-heading small { color: var(--muted); font-size: 8px; font-weight: 900; }
.letters-tray { display: grid; gap: 9px; align-items: stretch; }
.letters-tray.count-3 { grid-template-columns: repeat(3, 1fr); }
.letters-tray.count-4 { grid-template-columns: repeat(4, 1fr); }
.letters-tray.count-5 { grid-template-columns: repeat(5, 1fr); }
.letters-tray.count-6 { grid-template-columns: repeat(6, 1fr); }
.letters-tray.count-7 { grid-template-columns: repeat(7, 1fr); }
.letters-tray.count-8 { grid-template-columns: repeat(8, 1fr); }
.letters-tray.count-9 { grid-template-columns: repeat(9, 1fr); }
.letters-tray.count-10 { grid-template-columns: repeat(10, 1fr); }
.letter-tile.loose { min-height: 103px; }
.card-number { position: absolute; top: 5px; left: 5px; display: grid; width: 23px; height: 23px; place-items: center; padding-bottom: 1px; color: var(--ink); font-family: Georgia, serif; font-size: 9px; font-weight: 900; line-height: 1; background: #fff; border-radius: 50%; }
.tray-empty { grid-column: 1 / -1; margin: 42px 0 0; color: var(--muted); font-size: 12px; font-weight: 900; text-align: center; }
.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; 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.calm { background: #f2f6f2; border-color: #c8d5ca; }
.feedback-card.calm > span { background: #6e9b8d; }
.feedback-card.moving { background: #edf8f6; border-color: #9ed1c5; }

.letter-drag-ghost { position: fixed; z-index: 9999; top: 0; left: 0; display: grid; width: 74px; height: 84px; place-items: center; pointer-events: none; color: #fff; font-size: 39px; font-weight: 1000; background: var(--purple); border: 4px solid #755ba8; border-radius: 18px; 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 { position: relative; z-index: 2; }
.result-card h1 { position: relative; z-index: 2; margin: 0 0 12px; font-size: 55px; font-weight: 1000; letter-spacing: -.04em; }
.result-card > p:not(.eyebrow) { position: relative; z-index: 2; max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 15px; font-weight: 800; line-height: 1.5; }
.result-stars { position: relative; z-index: 2; margin: 18px 0; color: #e7a72e; font-size: 41px; letter-spacing: 8px; }
.result-stats { position: relative; z-index: 2; width: min(690px, 100%); justify-content: center; margin: 0 auto; overflow: hidden; background: rgba(255,255,255,.74); border: 2px solid var(--line); border-radius: 23px; }
.result-stats > span { flex: 1; min-width: 0; padding: 17px 9px; border-right: 2px solid var(--line); }
.result-stats > span:last-child { border-right: 0; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { font-family: Georgia, serif; font-size: 29px; line-height: 1; }
.result-stats small { margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.result-album { position: relative; z-index: 2; width: min(690px, 100%); gap: 13px; margin: 16px auto 0; padding: 13px 17px; text-align: left; background: #f2ecff; border: 2px solid #c9bae9; border-radius: 20px; }
.result-album > span { display: grid; width: 44px; height: 44px; place-items: center; font-size: 24px; background: #fff; border-radius: 12px; }
.result-album p { margin: 0; }
.result-album strong, .result-album small { display: block; }
.result-album strong { font-size: 13px; }
.result-album small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 800; }
.result-actions { position: relative; z-index: 2; justify-content: center; gap: 13px; margin-top: 25px; }

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

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 39px; }
  .hero-copy { max-width: 660px; }
  .hero-scene { min-height: 360px; margin-top: 10px; }
  .hero-desk { inset: 10px 3% 0; }
  .levels-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 245px; display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto 1fr auto; column-gap: 19px; }
  .level-top { grid-column: 1 / -1; }
  .level-preview { grid-row: 2 / 4; grid-column: 1; flex-wrap: wrap; align-content: center; }
  .level-copy { align-self: center; }
  .level-footer { grid-column: 2; }
  .collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .puzzle-board { grid-template-columns: 235px minmax(0, 1fr); }
  .picture-frame { min-height: 300px; }
  .picture-frame > span { font-size: 102px; }
  .letter-tile strong { font-size: 28px; }
}

@media (max-width: 760px) {
  .app { width: min(100% - 22px, 1120px); padding-top: 11px; }
  .topbar { min-height: 56px; gap: 7px; margin-bottom: 12px; }
  .brand { gap: 7px; }
  .brand-mark { width: 55px; height: 47px; padding: 4px; border-width: 2px; border-radius: 15px; }
  .brand-mark i, .brand-mark b, .brand-mark em { width: 19px; height: 29px; font-size: 12px; border-radius: 7px; }
  .brand strong { max-width: 225px; font-size: 17px; }
  .brand small { font-size: 7px; }
  .top-spark { display: none; }
  .collection-button, .sound-button, .back-button { min-height: 44px; border-radius: 14px; }
  .collection-button { padding: 4px 8px; }
  .collection-button strong { font-size: 10px; }
  .collection-button small { font-size: 8px; }
  .sound-button { width: 44px; padding: 0; justify-content: center; }
  .sound-button span:last-child { display: none; }
  .back-button { width: 44px; }
  .hero { min-height: 0; padding: 30px 24px; border-radius: 31px; }
  .hero h1 { font-size: 43px; }
  .hero-copy > p:not(.eyebrow) { font-size: 14px; }
  .hero-scene { min-height: 335px; }
  .hero-desk { inset-inline: 0; }
  .section-heading { align-items: flex-end; }
  .section-heading h2 { font-size: 32px; }
  .section-heading > p { max-width: 260px; font-size: 10px; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 92px; }
  .collection-section { padding: 22px 16px; border-radius: 28px; }
  .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-shell { padding: 20px; border-radius: 31px; }
  .game-heading h1 { font-size: 35px; }
  .puzzle-board { grid-template-columns: 1fr; padding: 14px; border-radius: 25px; }
  .picture-panel { display: grid; grid-template-columns: 170px 1fr; grid-template-rows: auto 1fr auto; align-items: center; column-gap: 18px; text-align: left; }
  .picture-panel .panel-label { grid-column: 1 / -1; }
  .picture-frame { grid-row: 2 / 4; min-height: 180px; }
  .picture-frame > span { font-size: 82px; }
  .picture-panel > p:not(.panel-label) { margin: 0 0 5px; }
  .assembly-panel { margin-top: 4px; }
  .tray-box { min-height: 190px; }
  .result-card { padding: 42px 24px; border-radius: 34px; }
  .result-card h1 { font-size: 45px; }
}

@media (max-width: 520px) {
  .app { width: calc(100% - 18px); }
  .topbar { align-items: flex-start; }
  .brand { flex: 1 1 auto; }
  .brand strong { max-width: 116px; font-size: 14px; white-space: normal; }
  .brand small { display: none; }
  .topbar-actions { gap: 5px; }
  .collection-button { max-width: 110px; }
  .collection-button > span:first-child { display: none; }
  .hero { padding: 27px 18px; }
  .hero h1 { font-size: 38px; }
  .hero .primary-button { width: 100%; padding-inline: 10px; }
  .hero-scene { min-height: 320px; }
  .hero-desk { border-width: 5px; border-radius: 28px; }
  .hero-picture { top: 25px; left: 17px; width: 112px; min-height: 105px; }
  .hero-picture span { font-size: 50px; }
  .hero-letters, .hero-slots { right: 15px; gap: 5px; }
  .hero-letters { top: 42px; }
  .hero-slots { bottom: 45px; }
  .hero-letters i, .hero-slots i { width: 49px; height: 58px; font-size: 27px; }
  .hero-arrow { right: 80px; top: 143px; }
  .how-section, .levels-section, .collection-section { margin-top: 36px; }
  .section-heading { display: block; }
  .section-heading > p { max-width: none; margin-top: 8px; text-align: left; }
  .level-card { display: flex; min-height: 333px; }
  .level-preview { flex-wrap: nowrap; }
  .level-preview i { width: 43px; height: 53px; font-size: 25px; }
  .level-footer { width: 100%; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .album-tile { min-height: 140px; }
  .play-note { align-items: flex-start; padding: 15px; }
  .game-shell { padding: 13px 9px; }
  .game-heading { align-items: flex-start; padding-inline: 3px; }
  .game-heading h1 { font-size: 31px; line-height: 1; }
  .round-badge { width: 64px; height: 64px; border-width: 7px; }
  .round-badge strong { font-size: 23px; }
  .mission-strip { display: block; padding: 11px; }
  .mission-strip > span { display: block; margin-top: 9px; text-align: center; }
  .progress-dots { gap: 4px; }
  .picture-panel { grid-template-columns: 128px 1fr; column-gap: 12px; }
  .picture-frame { min-height: 142px; border-radius: 24px; }
  .picture-frame > span { font-size: 66px; }
  .picture-panel > p:not(.panel-label) { font-size: 17px; }
  .assembly-heading { align-items: flex-start; flex-direction: column; }
  .assembly-heading h2 { font-size: 21px; }
  .tool-buttons { width: 100%; }
  .tool-buttons button { flex: 1; padding-inline: 8px; }
  .slots-row { min-height: 70px; gap: 4px; padding: 6px; border-radius: 16px; }
  .letter-slot { min-height: 55px; border-radius: 11px; }
  .slots-row.count-7 .letter-tile strong, .slots-row.count-8 .letter-tile strong, .slots-row.count-9 .letter-tile strong, .slots-row.count-10 .letter-tile strong { font-size: 20px; }
  .slot-number { width: 16px; height: 16px; font-size: 7px; }
  .tray-box { min-height: 225px; padding: 13px 9px; }
  .tray-heading { align-items: flex-start; }
  .tray-heading span { font-size: 12px; }
  .letters-tray.count-3, .letters-tray.count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .letters-tray.count-5, .letters-tray.count-6, .letters-tray.count-7, .letters-tray.count-8, .letters-tray.count-9, .letters-tray.count-10 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .letter-tile.loose { min-height: 83px; }
  .letter-tile strong { font-size: 28px; }
  .feedback-card { align-items: flex-start; flex-wrap: wrap; }
  .feedback-card .primary-button { width: 100%; }
  .result-card { padding: 34px 13px; }
  .result-card h1 { font-size: 38px; }
  .result-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .result-stats > span:nth-child(2) { border-right: 0; }
  .result-stats > span:nth-child(-n+2) { border-bottom: 2px solid var(--line); }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
}

@media (max-width: 355px) {
  .brand strong { max-width: 92px; font-size: 13px; }
  .collection-button { max-width: 99px; }
  .hero-letters i, .hero-slots i { width: 45px; }
  .letter-tile strong { font-size: 25px; }
}
