:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #2d504d;
  --muted: #6b817d;
  --paper: #fffdf7;
  --line: #ddd5b9;
  --green: #62b486;
  --green-dark: #35795f;
  --gold: #f2bc49;
  --coral: #ef7468;
  --blue: #62acd6;
  --purple: #8b73bd;
  --pink: #df78a8;
  --shadow: 0 20px 48px rgba(57, 82, 73, .14);
  --soft-shadow: 0 10px 25px rgba(57, 82, 73, .1);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #f6f7ef; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: clip; color: var(--ink); background: radial-gradient(circle at 8% 8%, rgba(98,172,214,.19) 0 120px, transparent 122px), radial-gradient(circle at 94% 9%, rgba(223,120,168,.17) 0 150px, transparent 152px), linear-gradient(145deg,#f2f9ee 0%,#fffaf2 53%,#f4effb 100%); }
body::before { position: fixed; inset: 0; z-index: -1; opacity: .13; background-image: linear-gradient(rgba(87,125,114,.28) 1px,transparent 1px),linear-gradient(90deg,rgba(87,125,114,.28) 1px,transparent 1px); background-size: 32px 32px; content: ""; pointer-events: none; }
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(242,188,73,.8); 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.3s ease-in-out infinite alternate; }
.loading-card p { margin: 0; font-size: 19px; font-weight: 900; }

.topbar,.topbar-actions,.brand,.album-button,.sound-button,.game-head,.board-toolbar,.feedback,.feedback>div,.result-actions,.result-stats { display: flex; align-items: center; }
.topbar { 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 { display: grid; flex: 0 0 auto; width: 56px; height: 56px; place-items: center; font-size: 29px; background: #e7f7f9; border: 3px solid #b9d9dc; border-radius: 19px; box-shadow: 0 7px 16px rgba(67,87,78,.12); transform: rotate(-4deg); }
.brand strong,.brand small,.album-button strong,.album-button small { display: block; }
.brand strong { overflow: hidden; font-size: 25px; 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: .08em; text-transform: uppercase; }
.topbar-actions { flex: 0 0 auto; gap: 8px; }
.album-button,.sound-button { min-height: 49px; color: var(--ink); font-weight: 900; background: rgba(255,253,247,.95); border: 2px solid var(--line); border-radius: 17px; box-shadow: 0 7px 16px rgba(65,83,76,.08); }
.album-button { gap: 8px; padding: 5px 12px; text-align: left; }
.album-button>span:first-child,.sound-button>span:first-child { font-size: 20px; }
.album-button strong { font-size: 12px; }
.album-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.sound-button { display: inline-flex; gap: 7px; padding: 0 14px; font-size: 12px; }
.eyebrow { margin: 0 0 9px; color: #3c7e66; font-family: Georgia,serif; font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.primary-button,.secondary-button,.hint-button { display: inline-flex; min-height: 53px; align-items: center; justify-content: center; gap: 8px; padding: 0 21px; font-weight: 1000; border-radius: 17px; transition: transform 150ms ease,box-shadow 150ms ease; }
.primary-button { color: #fff; background: #3e9875; border: 0; box-shadow: 0 8px 0 #2f785e,0 16px 27px rgba(49,122,94,.2); }
.secondary-button { color: var(--ink); background: #fffdf6; border: 2px solid #d7d2b9; box-shadow: 0 6px 0 #ddd7c4; }
.secondary-button.compact { min-height: 47px; padding: 0 15px; font-size: 12px; }
.hint-button { min-height: 48px; color: #715418; background: #fff3c5; border: 2px solid #e7bd50; box-shadow: 0 5px 0 #d8aa39; }
.primary-button:not(:disabled):hover,.secondary-button:not(:disabled):hover,.hint-button:not(:disabled):hover,.album-button:hover,.sound-button:hover { transform: translateY(-2px); }
.primary-button:not(:disabled):active,.secondary-button:not(:disabled):active,.hint-button:not(:disabled):active { transform: translateY(3px); box-shadow: none; }
button:disabled { cursor: default; opacity: .52; }

.hero { position: relative; display: grid; min-height: 420px; grid-template-columns: minmax(0,1fr) minmax(400px,.95fr); align-items: center; gap: 38px; overflow: hidden; padding: 48px 51px; background: radial-gradient(circle at 94% 4%,rgba(98,172,214,.24) 0 110px,transparent 112px),linear-gradient(120deg,#fffaf0,#eff8fa 56%,#f9eff6); border: 3px solid #ded6ba; border-radius: 42px; box-shadow: var(--shadow); }
.hero::after { position: absolute; right: -53px; bottom: -90px; width: 210px; height: 210px; background: rgba(223,120,168,.13); border-radius: 50%; content: ""; }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { margin: 0 0 16px; font-size: clamp(47px,5vw,67px); font-weight: 1000; line-height: .95; letter-spacing: -.045em; }
.hero h1 span { color: #4e9dc5; }
.hero-copy>p:not(.eyebrow) { max-width: 535px; margin-bottom: 25px; color: var(--muted); font-size: 17px; font-weight: 700; line-height: 1.5; }
.hero-scene { position: relative; z-index: 2; min-height: 320px; }
.hero-paper { position: absolute; inset: 8px 14px 12px; overflow: hidden; background: #fffefa; border: 6px solid #fff; border-radius: 32px; box-shadow: 0 20px 34px rgba(62,80,74,.18); transform: rotate(1.5deg); }
.hero-paper::before { position: absolute; inset: 0; opacity: .22; background-image: radial-gradient(#89a99e 1px,transparent 1px); background-size: 18px 18px; content: ""; }
.hero-paper svg { position: absolute; inset: 4%; width: 92%; height: 92%; }
.hero-half,.hero-mirror { fill: none; stroke: #4f8d7b; stroke-width: 13; stroke-linecap: round; }
.hero-mirror { stroke: #df78a8; stroke-dasharray: 500; animation: drawHero 2.8s ease-in-out infinite alternate; }
.hero-fill { fill: rgba(98,180,134,.16); stroke: none; }
.hero-fold { fill: none; stroke: #8eb7bc; stroke-width: 4; stroke-dasharray: 8 12; }
.hero-start { fill: #fff3bd; stroke: #e1a92e; stroke-width: 7; animation: markerPulse 1s ease-in-out infinite alternate; }
.hero-paper text { fill: #71918b; font-size: 18px; font-weight: 900; text-anchor: middle; }
.hero-pencil { position: absolute; z-index: 3; right: 14px; bottom: 31px; font-size: 51px; filter: drop-shadow(0 7px 5px rgba(55,75,69,.18)); transform: rotate(-31deg); }
.hero-note { position: absolute; z-index: 4; left: 18px; bottom: 9px; padding: 8px 13px; color: #fff; font-size: 11px; font-weight: 900; background: #4f8775; border-radius: 13px; transform: rotate(-2deg); }

.how-section,.levels-section,.album-section { margin-top: 54px; scroll-margin-top: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading h1,.section-heading h2 { margin: 0; font-size: 39px; font-weight: 1000; line-height: 1; letter-spacing: -.035em; }
.section-heading>p { max-width: 430px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.45; text-align: right; }
.steps-grid,.levels-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.step-card { display: flex; min-width: 0; min-height: 132px; align-items: center; gap: 16px; padding: 23px; background: rgba(255,253,247,.94); border: 2px solid var(--line); border-radius: 29px; box-shadow: var(--soft-shadow); }
.step-number { display: grid; flex: 0 0 auto; width: 62px; height: 62px; place-items: center; padding-bottom: 3px; color: #fff; font-family: Georgia,serif; font-size: 27px; font-weight: 900; background: var(--blue); border: 8px solid #dff1f8; border-radius: 50%; }
.step-card:nth-child(2) .step-number { background: var(--gold); border-color: #fff0c7; }
.step-card:nth-child(3) .step-number { background: var(--pink); border-color: #fae4ee; }
.step-card strong,.step-card small { display: block; }
.step-card strong { margin-bottom: 6px; font-size: 18px; font-weight: 1000; }
.step-card small { color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.45; }
.level-card { position: relative; min-width: 0; overflow: hidden; padding: 27px; background: var(--paper); border: 3px solid color-mix(in srgb,var(--accent) 42%,#e2dbc4); border-radius: 31px; box-shadow: var(--soft-shadow); }
.level-card::before { position: absolute; right: -40px; top: -46px; width: 145px; height: 145px; background: color-mix(in srgb,var(--accent) 14%,transparent); border-radius: 50%; content: ""; }
.level-icon { position: relative; display: grid; width: 64px; height: 64px; margin-bottom: 19px; place-items: center; color: #fff; font-size: 27px; font-weight: 1000; background: var(--accent); border: 8px solid color-mix(in srgb,var(--accent) 19%,white); border-radius: 22px; transform: rotate(-4deg); }
.level-card h3 { position: relative; margin: 0 0 8px; font-size: 23px; font-weight: 1000; }
.level-card>p:not(.eyebrow) { min-height: 62px; margin-bottom: 17px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.5; }
.level-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.level-progress>span { flex: 1; height: 11px; overflow: hidden; background: #eee9d8; border-radius: 99px; }
.level-progress i { display: block; width: var(--value); height: 100%; background: var(--accent); border-radius: inherit; }
.level-progress b { min-width: 34px; font-size: 12px; }
.level-card .secondary-button { width: 100%; min-height: 49px; }
.adult-note { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 18px 22px; background: rgba(231,247,249,.82); border: 2px dashed #86bdc6; border-radius: 23px; }
.adult-note span { font-size: 29px; }
.adult-note p { margin: 0; color: #426b69; font-size: 13px; font-weight: 800; line-height: 1.45; }

.game-shell { min-height: 760px; padding: 28px; background: rgba(255,253,247,.96); border: 3px solid var(--line); border-radius: 40px; box-shadow: var(--shadow); }
.game-head { justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.game-head>div { min-width: 0; }
.game-head h1 { margin: 0 0 6px; font-size: clamp(28px,4vw,43px); font-weight: 1000; line-height: 1; letter-spacing: -.035em; }
.game-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; }
.game-head>span { flex: 0 0 auto; padding: 11px 15px; color: #fff; font-size: 13px; font-weight: 1000; background: var(--accent); border-radius: 16px; }
.board-card { position: relative; overflow: hidden; padding: 16px; background: linear-gradient(#fffefa,#fffaf2); border: 3px solid #e2dac4; border-radius: 32px; }
.board-toolbar { position: relative; z-index: 2; justify-content: space-between; gap: 12px; margin-bottom: 9px; padding: 0 4px; }
.board-toolbar>div { display: flex; gap: 8px; }
.task-chip { display: inline-flex; min-height: 43px; align-items: center; gap: 9px; padding: 0 14px; color: #3c6f60; font-size: 13px; font-weight: 1000; background: #edf8f0; border: 2px solid #b8dbc6; border-radius: 15px; }
.task-chip b { font-size: 18px; }
.mirror-board { display: block; width: 100%; height: auto; max-height: 510px; aspect-ratio: 800/520; touch-action: none; user-select: none; }
.board-paper { fill: url(#paperShade); stroke: #dfe0d2; stroke-width: 3; }
.half-fill { fill: var(--accent); opacity: .13; transition: opacity .35s ease; }
.right-fill { opacity: 0; }
.ready-path,.target-path,.user-path,.fold-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ready-path { stroke: #3f7467; stroke-width: 11; filter: drop-shadow(0 4px 2px rgba(57,81,73,.1)); }
.target-path { stroke: var(--gold); stroke-width: 8; stroke-dasharray: 7 15; opacity: 0; transition: opacity .16s ease; }
.fold-line { stroke: #9bc0c3; stroke-width: 4; stroke-dasharray: 9 13; }
.user-path { stroke: #df78a8; stroke-width: 12; filter: drop-shadow(0 4px 2px rgba(76,67,85,.1)); transition: stroke .2s ease; }
.guide-dots circle { fill: #fff6cf; stroke: #d4a13a; stroke-width: 4; }
.endpoint { fill: #fffdf7; stroke: #d5a233; stroke-width: 6; }
.endpoint-start { fill: #fff0aa; animation: markerPulse 1s ease-in-out infinite alternate; }
.start-star { fill: #9b721e; font-size: 27px; font-weight: 1000; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.end-center { fill: #d5a233; pointer-events: none; }
.mirror-board.is-drawing .endpoint-start { opacity: .42; }
.mirror-board.is-hinting .target-path { opacity: .92; animation: guideGlow .75s ease-in-out infinite alternate; }
.mirror-board.is-error .user-path { stroke: var(--coral); }
.mirror-board.is-complete .user-path { stroke: var(--accent); }
.mirror-board.is-complete .right-fill,.mirror-board.is-complete .half-fill { opacity: .2; }
.mirror-board.is-complete .target-path,.mirror-board.is-complete .guide-dots,.mirror-board.is-complete .endpoint,.mirror-board.is-complete .start-star,.mirror-board.is-complete .end-center { opacity: 0; }
.success-decor { color: var(--ink); opacity: 0; transition: opacity .35s ease .1s; }
.success-decor>* { fill: none; stroke: #355f59; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.success-decor circle,.success-decor ellipse,.success-decor rect { fill: #fff5d8; }
.mirror-board.is-complete .success-decor { opacity: 1; }
.picture-name { opacity: 0; transition: opacity .3s ease .12s; }
.picture-name rect { fill: #fffdf7; stroke: var(--accent); stroke-width: 4; }
.picture-name text { fill: var(--ink); font-size: 25px; font-weight: 1000; text-anchor: middle; dominant-baseline: central; }
.mirror-board.is-complete .picture-name { opacity: 1; }
.board-card.wrong-start { animation: shake .32s ease; }

.feedback { min-height: 82px; justify-content: space-between; gap: 15px; margin-top: 14px; padding: 15px 17px; background: #f3f7f0; border: 2px solid #d4dfd4; border-radius: 22px; }
.feedback>div { min-width: 0; gap: 12px; }
.feedback-icon { display: grid; flex: 0 0 auto; width: 45px; height: 45px; place-items: center; font-size: 23px; background: #fff; border-radius: 15px; box-shadow: 0 5px 12px rgba(55,78,70,.1); }
.feedback p { margin: 0; }
.feedback strong,.feedback small { display: block; }
.feedback strong { margin-bottom: 3px; font-size: 15px; font-weight: 1000; }
.feedback small { color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.35; }
.feedback.is-error { background: #fff1ef; border-color: #f0b3ac; }
.feedback.is-hint { background: #fff7d9; border-color: #e7ca72; }
.feedback.is-drawing { background: #eef7fb; border-color: #b6d8e8; }
.feedback.is-success { background: #e9f7ee; border-color: #a9d6b9; }
.feedback .primary-button { min-height: 48px; white-space: nowrap; }

.result-card { position: relative; overflow: hidden; min-height: 560px; padding: 54px; text-align: center; background: radial-gradient(circle at 50% 0,rgba(98,172,214,.23),transparent 35%),var(--paper); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.result-card::before,.result-card::after { position: absolute; width: 180px; height: 180px; border-radius: 50%; content: ""; }
.result-card::before { left: -85px; top: -75px; background: rgba(98,172,214,.14); }
.result-card::after { right: -85px; bottom: -80px; background: rgba(223,120,168,.14); }
.result-badge { display: grid; width: 105px; height: 105px; margin: 0 auto 23px; place-items: center; font-size: 50px; background: #e8f5f8; border: 9px solid #f4fbfc; border-radius: 34px; box-shadow: 0 13px 24px rgba(66,84,75,.13); transform: rotate(-4deg); }
.result-card h1 { margin-bottom: 13px; font-size: clamp(40px,6vw,65px); font-weight: 1000; line-height: .95; letter-spacing: -.045em; }
.result-card>p:not(.eyebrow) { max-width: 620px; margin: 0 auto 28px; color: var(--muted); font-size: 16px; font-weight: 700; line-height: 1.5; }
.result-stats { max-width: 600px; justify-content: center; gap: 12px; margin: 0 auto 31px; }
.result-stats div { min-width: 150px; padding: 15px; background: #f3f7f5; border: 2px solid #d8e4df; border-radius: 20px; }
.result-stats b,.result-stats span { display: block; }
.result-stats b { margin-bottom: 3px; font-size: 25px; }
.result-stats span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.result-actions { justify-content: center; gap: 12px; }

.album-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 19px 23px; background: #eaf7f8; border: 2px solid #a8cfd5; border-radius: 25px; }
.album-summary p { margin: 0; color: #456b6c; font-size: 14px; font-weight: 800; line-height: 1.45; }
.album-summary b { flex: 0 0 auto; font-size: 29px; }
.album-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.album-card { min-width: 0; padding: 15px; background: var(--paper); border: 2px solid var(--line); border-radius: 25px; box-shadow: var(--soft-shadow); }
.album-picture { position: relative; overflow: hidden; aspect-ratio: 4/3; background: linear-gradient(90deg,#eef8f4 50%,#fff2f8 50%); border-radius: 18px; }
.album-picture svg { width: 100%; height: 100%; }
.album-picture svg>path { fill: var(--accent); opacity: .22; stroke: var(--accent); stroke-width: 8; }
.album-picture svg g>* { fill: #fff5d8; stroke: #355f59; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.album-picture.is-locked { display: grid; place-items: center; color: #8a958f; font-size: 33px; background: repeating-linear-gradient(135deg,#f4f1e8 0 12px,#faf8f1 12px 24px); }
.album-card strong { display: block; margin: 12px 3px 3px; font-size: 16px; }
.album-card small { display: block; margin: 0 3px; color: var(--muted); font-size: 11px; font-weight: 800; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: calc(100% - 32px); padding: 12px 18px; color: #fff; font-size: 13px; font-weight: 900; text-align: center; background: #315f55; border-radius: 14px; box-shadow: 0 10px 25px rgba(36,66,59,.25); opacity: 0; pointer-events: none; transform: translate(-50%,18px); transition: opacity .2s ease,transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }

@keyframes drawHero { from { stroke-dashoffset: 500; } to { stroke-dashoffset: 0; } }
@keyframes markerPulse { to { transform: scale(1.15); transform-origin: center; } }
@keyframes guideGlow { to { stroke-width: 12; } }
@keyframes float { to { transform: translateY(-10px) rotate(4deg); } }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

@media (max-width:900px) {
  .hero { grid-template-columns: 1fr; padding: 39px; }
  .hero-copy { max-width: 660px; }
  .hero-scene { min-height: 300px; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 104px; }
  .levels-grid,.album-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .game-shell { min-height: 0; }
}

@media (max-width:650px) {
  .app { width: min(100% - 20px,1120px); padding-top: 12px; }
  .topbar { min-height: 57px; margin-bottom: 13px; }
  .brand { flex: 1 1 auto; overflow: hidden; }
  .brand>span:last-child { min-width: 0; }
  .brand-mark { width: 49px; height: 49px; font-size: 25px; border-radius: 16px; }
  .brand strong { max-width: 155px; font-size: 18px; }
  .brand small { display: none; }
  .album-button,.sound-button { width: 48px; justify-content: center; padding: 0; }
  .album-button div,.sound-button>span:last-child { display: none; }
  .hero { min-height: 0; gap: 24px; padding: 30px 22px 25px; border-radius: 31px; }
  .hero h1 { font-size: clamp(40px,12.5vw,56px); }
  .hero-copy>p:not(.eyebrow) { font-size: 15px; }
  .hero-scene { min-height: 245px; }
  .hero-paper { inset: 4px 4px 14px; }
  .how-section,.levels-section,.album-section { margin-top: 38px; }
  .section-heading { display: block; }
  .section-heading h1,.section-heading h2 { font-size: 32px; }
  .section-heading>p { margin-top: 9px; text-align: left; }
  .levels-grid,.album-grid { grid-template-columns: 1fr; }
  .level-card>p:not(.eyebrow) { min-height: 0; }
  .adult-note { align-items: flex-start; }
  .game-shell { padding: 14px; border-radius: 28px; }
  .game-head { align-items: flex-start; gap: 9px; }
  .game-head h1 { font-size: 27px; }
  .game-head>span { padding: 9px 10px; font-size: 11px; }
  .board-card { padding: 8px; border-radius: 23px; }
  .board-toolbar { align-items: stretch; }
  .task-chip { min-height: 40px; padding: 0 9px; font-size: 10px; }
  .task-chip b { font-size: 16px; }
  .board-toolbar>div button,
  .board-toolbar>div button.secondary-button.compact { width: 46px; min-height: 46px; padding: 0; font-size: 0; }
  .board-toolbar>div button span { font-size: 18px; }
  .mirror-board { min-height: 270px; }
  .endpoint-start { r: 60px; }
  .endpoint-end { r: 56px; }
  .start-star { font-size: 48px; }
  .end-center { r: 10px; }
  .guide-dots circle { r: 15px; }
  .feedback { align-items: flex-start; flex-direction: column; min-height: 105px; }
  .feedback .primary-button { width: 100%; }
  .result-card { min-height: 0; padding: 40px 18px; border-radius: 31px; }
  .result-stats,.result-actions { align-items: stretch; flex-direction: column; }
  .result-stats div { min-width: 0; }
  .album-summary { align-items: flex-start; flex-direction: column; }
}

@media (max-width:390px) {
  .brand strong { max-width: 133px; font-size: 17px; }
}

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