:root{color-scheme:dark;--ink:#ecf5f2;--muted:#a7bbc2;--a:#9ceacb;--b:#ffbd93;--line:#334e5a}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#101820;color:var(--ink);font:15px/1.5 system-ui,-apple-system,sans-serif}body{background:radial-gradient(ellipse at 15% 0,#17363b 0,transparent 60%),#101820}.echo-enhanced{overflow:hidden;overscroll-behavior:none}a{color:var(--a);text-underline-offset:4px}button,select{font:inherit;color:var(--ink);border:1px solid var(--line);background:#22343e;border-radius:10px}button{min-height:44px;padding:8px 12px;cursor:pointer;touch-action:manipulation}button:hover{background:#304650}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid var(--a);outline-offset:3px}[hidden]{display:none!important}.echo-app{width:100%;max-width:640px;height:100vh;height:100svh;margin:auto;padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));display:grid;grid-template-rows:40px minmax(0,1fr);gap:8px}.echo-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;min-width:0}.echo-header>a{font-size:12px;text-decoration:none;padding:8px 0}.echo-header h1{font-size:17px;line-height:1.2;text-align:center;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.5px}.echo-header button{min-height:36px;font-size:12px;padding:6px 10px}.echo-game{min-height:0;display:grid;grid-template-rows:40px 32px 20px minmax(0,1fr) 26px 38px 46px 44px;gap:6px;padding:12px;border:1px solid #3b535c;border-radius:20px;background:linear-gradient(145deg,#1c3039,#17252f);box-shadow:0 15px 60px #0003}.echo-stagebar{display:flex;justify-content:space-between;align-items:center;gap:10px;min-width:0}.echo-stagebar>div{min-width:0}.echo-stagebar p{font-size:10px;color:var(--a);margin:0 0 2px}.echo-stagebar h2{margin:0;font-size:16px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.echo-picker{font-size:10px;color:var(--muted);max-width:45%;min-width:100px;display:flex;align-items:center;gap:5px}.echo-picker>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}select{min-width:0;max-width:100%;min-height:36px;padding:6px;font-size:12px}.echo-picker select{width:100%}.echo-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-block:1px solid var(--line);align-items:center}.echo-stats>div{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0}.echo-stats>div+div{border-left:1px solid var(--line)}.echo-stats span{font-size:11px;color:var(--muted)}.echo-stats strong{font-size:19px;font-variant-numeric:tabular-nums}.echo-legend{display:flex;gap:18px;justify-content:center;align-items:center;font-size:11px}.echo-legend i{font-style:normal}.legend-a{color:var(--a)}.legend-b{color:var(--b)}.echo-legend small{opacity:.7}.echo-board-slot{display:grid;place-items:center;min-height:0;min-width:0;overflow:hidden}.echo-board{width:var(--board-edge,min(100%,calc(100svh - 380px)));height:var(--board-edge,auto);aspect-ratio:1;display:grid;grid-template-columns:repeat(var(--size),minmax(0,1fr));grid-template-rows:repeat(var(--size),minmax(0,1fr));gap:5px;padding:7px;border:1px solid #45606b;border-radius:15px;background:#0f1e28;touch-action:none;container-type:inline-size;user-select:none;-webkit-user-select:none}.echo-cell{min-width:0;min-height:0;position:relative;display:grid;place-items:center;background:linear-gradient(145deg,#223943,#1b2e38);border:1px solid #34515d;border-radius:8px;overflow:hidden}.echo-cell.wall{border-color:#1b2d36;background:repeating-linear-gradient(135deg,#101d27,#101d27 5px,#172831 5px,#172831 6px)}.echo-cell.goal-a{background:#23463e;border-color:#639d88}.echo-cell.goal-b{background:#433b36;border-color:#a28368}.echo-goal{position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(18px,calc(100cqw / var(--size) * .75),64px);line-height:1;opacity:.65}.a{color:var(--a)}.b{color:var(--b)}.echo-token{position:absolute;z-index:2;font-size:clamp(15px,calc(100cqw / var(--size) * .55),48px);line-height:1;filter:drop-shadow(0 0 8px #9ceacb55);animation:star-arrive .15s ease-out}.echo-token.b{filter:drop-shadow(0 0 8px #ffbd9344)}.overlap .echo-token.a{transform:translate(-20%,-14%);scale:.8}.overlap .echo-token.b{transform:translate(22%,20%);scale:.8}.echo-preview{position:absolute;right:3px;bottom:3px;color:var(--b);opacity:.7;font-size:clamp(9px,calc(100cqw / var(--size) * .2),17px);line-height:1}.is-complete{border-color:var(--a);box-shadow:0 0 18px #9ceacb16}.echo-queue{display:flex;gap:9px;align-items:center;justify-content:center;font-size:11px;color:var(--muted)}.echo-queue strong{color:var(--b);font-size:22px;line-height:1;min-width:20px;text-align:center}.echo-queue small{font-size:11px;color:var(--b)}.echo-status{font-size:12px;line-height:18px;text-align:center;margin:0;color:#d1e5df;align-self:center;max-height:38px;overflow:auto}.echo-navigation{min-height:0}.echo-controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;height:100%;max-width:360px;margin:auto}.echo-dir{font-size:25px;font-weight:600;padding:3px 12px;min-height:44px}.dir-L{order:0}.dir-U{order:1}.dir-D{order:2}.dir-R{order:3}.echo-dir.is-hint{border-color:var(--b);box-shadow:inset 0 0 0 2px #ffbd9366;color:var(--b)}.echo-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.echo-actions button{font-size:12px;padding:6px;min-height:44px}.echo-next{display:block;width:100%;height:100%;background:var(--a);color:#142c24;border:0;font-weight:800}.echo-next:hover{background:#b6f4dd}.echo-complete .echo-controls{display:none}.echo-history{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted);padding:10px 0;border-block:1px solid var(--line)}.echo-history>span:last-child{letter-spacing:3px;color:#d1e3e3}.echo-storage{font-size:12px;line-height:1.7;color:var(--muted)}#echo-help{width:min(680px,calc(100vw - 24px));max-height:calc(100svh - 32px);padding:0;border:1px solid #5b7d83;border-radius:20px;background:#172831;color:var(--ink);overflow:hidden}#echo-help[open]{display:flex;flex-direction:column}#echo-help::backdrop{background:#050d17bd;backdrop-filter:blur(5px)}.echo-helpbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid var(--line);flex:none}.echo-helpbar h2{font-size:18px;margin:0}.echo-help-scroll{padding:0 20px 20px;overflow-y:auto;overscroll-behavior:contain}.echo-help-intro h2{font-size:25px;margin:20px 0 10px}.echo-help-intro h3{font-size:16px;margin-bottom:8px;color:var(--a)}.echo-help-intro p{font-size:14px;line-height:1.8;color:#bfd2d4}.echo-help-intro label{display:flex;align-items:center;gap:10px;font-size:13px}.echo-story h2{font-size:21px;margin-top:30px}.echo-story h3{font-size:16px;color:#d7e6e3;margin-top:22px}.echo-story p{font-size:14px;color:#bfd2d4;line-height:1.8}.echo-story details{border:1px solid var(--line);border-radius:12px;padding:14px}.echo-story summary{cursor:pointer;color:var(--a)}.echo-stage-notes{padding-left:22px}.echo-stage-notes small{color:var(--b)}footer{font-size:12px;border-top:1px solid var(--line);padding-top:16px;margin-top:25px;color:var(--muted)}.echo-nojs{padding:20px;max-width:650px;margin:auto}@keyframes star-arrive{from{opacity:.6;scale:.85}to{opacity:1;scale:1}}@media(max-width:360px){.echo-game{padding:8px;gap:5px}.echo-header h1{font-size:15px}.echo-header>a{font-size:10px}.echo-stats span{font-size:10px}.echo-actions button{font-size:11px}.echo-board{gap:4px;padding:5px}.echo-stagebar h2{font-size:14px}}@media(min-width:640px) and (max-height:600px){.echo-app{max-width:1040px;grid-template-rows:32px minmax(0,1fr);gap:6px}.echo-header button{min-height:30px}.echo-game{grid-template-columns:minmax(0,1.2fr) minmax(240px,1fr);grid-template-rows:34px 26px 18px 24px minmax(0,1fr) 44px 44px;gap:5px 18px;padding:10px}.echo-board-slot{grid-column:1;grid-row:1/-1}.echo-stagebar{grid-column:2;grid-row:1}.echo-stats{grid-column:2;grid-row:2}.echo-legend{grid-column:2;grid-row:3}.echo-queue{grid-column:2;grid-row:4}.echo-status{grid-column:2;grid-row:5}.echo-navigation{grid-column:2;grid-row:6}.echo-actions{grid-column:2;grid-row:7}.echo-picker select{min-height:32px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

.echo-practice{margin:12px 0;padding:12px;border:1px solid #648089;border-radius:14px;background:#1a3039}.echo-practice #echo-practice-board{width:min(100%,260px);height:auto;aspect-ratio:1;margin:10px auto;--board-edge:min(260px,100%)}.echo-practice-controls{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.echo-practice-controls button,.echo-practice-actions button{min-height:44px}.echo-practice-controls button:not(:disabled){background:#a1ed59;color:#14251a}.echo-practice-actions{display:flex;gap:8px;margin-top:8px}.echo-practice [hidden]{display:none!important}

.service-links{display:flex;flex-wrap:wrap;gap:8px 14px;margin:16px 0;font-size:12px}.service-links a{display:inline-block;padding:4px 0}

.echo-app:has(.game-site-footer){grid-template-rows:40px minmax(0,1fr) auto}.game-site-footer{margin:0;padding:0;border:0}.game-site-footer .service-links{justify-content:center;margin:0;gap:3px 12px;line-height:1.2;font-size:11px}.game-site-footer .service-links a{padding:5px 0}.echo-help-scroll .service-links{line-height:1.6}@media(min-width:640px) and (max-height:600px){.echo-app:has(.game-site-footer){grid-template-rows:32px minmax(0,1fr) auto}}

/* The game fits the first viewport; its textual guide remains scrollable below it. */
html.echo-enhanced{overflow-y:auto}.game-guide-below{width:min(100%,680px);margin:24px auto;padding:20px;color:#d4e5e2;line-height:1.8}.game-guide-below h2{font-size:21px}.game-guide-below h3{font-size:17px;color:#a1edc7}.game-guide-below h4{font-size:15px}.game-guide-below p,.game-guide-below li{font-size:14px}.game-guide-below li{margin:12px 0}
