:root{--atlas:url('assets/link-animals-v2.png');--link-rows:6;color:#4d642e;background:#178ec0}
body{--link-cell:clamp(32px,min(58px,calc((100vw - 100px)/6),calc((100dvh - 480px)/var(--link-rows))),58px);min-height:100dvh;max-width:520px;margin:0 auto;background:#159bd5;box-shadow:0 0 100px #06557666}
.world{max-width:520px;margin:auto;background:#169bd4 url('assets/match-sky.png') center/cover no-repeat;filter:none!important}
.world:after{background:linear-gradient(#08a0e000 55%,#8ad7e91c)}
.atmosphere,.left-rail,.right-rail,.mini-brand,.game-title .title-leaf,.stage-decoration,.game-title .logo-leaf,.mode-caret,.stage-row #theme-name,.stage-row .level-sep,.topbar #sound,.topbar #language,.tool-key,.page-footer{display:none!important}
.topbar{max-width:480px;height:61px;padding:10px 17px 5px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.link-home-button{width:37px;height:37px;display:grid;place-items:center;border:2px solid #fff4c3;border-radius:13px;background:linear-gradient(#b2e558,#6bba36);box-shadow:0 3px #438b2c,inset 0 1px #eeffbd;color:white;font-size:30px;line-height:1;text-shadow:0 2px #5e9e32}
.top-actions{gap:8px}.round-button{width:34px;height:34px;padding:6px;border:2px solid #fff6d8;background:linear-gradient(#fff5b3,#f2c36a);box-shadow:0 3px #b57f3e;color:#8a6526}.round-button svg{width:18px;height:18px}
.star-wallet{background:linear-gradient(#b67b3c,#8a5226);border:2px solid #e5b364;padding:4px 10px;min-width:70px;height:33px;box-shadow:0 3px #65411c;color:#fff3a5}.star-wallet svg{fill:#ffcf35;stroke:#f8e596;width:21px;height:21px}.star-wallet b{color:#fff7bf;font-size:17px}.star-wallet>span{display:none}
.game-layout{display:block;max-width:480px;margin:0 auto;padding:0 12px}.play-column{min-width:0;position:relative}
.game-title{margin:1px auto 11px;text-align:center}.game-title h1{display:block;margin:0;color:#fff4a4;font-size:32px!important;letter-spacing:3px;font-weight:1000;text-shadow:0 3px #367c2d,2px 0 #367c2d,-2px 0 #367c2d,0 -1px #367c2d,0 5px 5px #075f6255;line-height:1.2}.game-title p{font-size:10px;color:#eaffec;text-shadow:0 1px 2px #246c74;margin:6px 0 0;letter-spacing:1px}
.stage-row{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 0 13px;min-height:26px}.level-pill{padding:4px 18px;border-radius:22px;background:#147e9c99;color:#ffffdf;font-size:12px;border:1px solid #89e7df80;box-shadow:0 2px #0c77955c}.level-pill b{font-size:14px;font-weight:900}#boss-badge{font-size:10px;color:#ffef91}.pause-button{position:static;display:grid;place-items:center;width:29px;height:29px;border-radius:50%;border:2px solid #e1ffe6;background:#80ce69c9;box-shadow:0 2px #438c4c;color:#fff}.pause-button svg{width:15px;height:15px}
.hud{max-width:408px;margin:0 auto 9px;padding:13px 8px 9px 13px;display:grid;grid-template-columns:minmax(0,1fr) 89px;gap:12px;align-items:center;position:relative;height:84px;border:5px solid #b77a3b;border-bottom-color:#8e572e;border-radius:17px;background:linear-gradient(#ffedb8,#f4d88f);box-shadow:inset 0 1px 0 #fff8d5,0 4px 0 #755129,0 6px 10px #0a61882c}
.hud:before,.hud:after{content:'';position:absolute;width:6px;height:6px;border-radius:50%;top:7px;background:#865229;box-shadow:inset 0 1px 2px #5b4119}.hud:before{left:4px}.hud:after{right:4px}
.mode-button{position:absolute;left:12px;top:-14px;max-width:160px;z-index:1;display:flex;gap:4px;align-items:center;border:2px solid #f7ffb7;background:linear-gradient(#a5d754,#6daf32);box-shadow:0 2px #507a2b;border-radius:20px;padding:4px 10px;color:#fffbe0;font-size:9px;line-height:1.2}.mode-button svg{width:12px;height:12px}
.progress-block{padding:0 2px}.progress-label{font-size:10px;color:#876328;letter-spacing:.3px}.progress-label b{font-size:15px;color:#6a8c32}.progress-track{height:12px;border:2px solid #d0ae69;background:#cdb57f;border-radius:15px;box-shadow:inset 0 2px 2px #7f713a33}.progress-track>div{height:100%;background:linear-gradient(#b8f156,#6cbd2a);border-radius:10px;box-shadow:inset 0 1px #d8ff9e}.progress-track>svg{width:13px;height:13px;fill:#87bd2b;stroke:#efffb2;top:-3px;right:-3px}
.timer{margin:0;display:flex;align-items:center;justify-content:center;gap:4px;padding:12px 4px;background:linear-gradient(#9ccf59,#78ad3a);border:2px solid #e6f4ad;box-shadow:0 2px #62862f,inset 0 1px #d1ee8a;border-radius:12px;color:#faffde}.timer svg{width:15px;height:15px;stroke:#f4ffce}.timer strong{font:900 21px Arial;color:#fffcd5}.time-warning .timer{background:linear-gradient(#ffb65d,#e9823e)}
.objective-row{max-width:400px;margin:10px auto 9px;font-size:8px;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#e8fff6;text-shadow:0 1px #367c88}.objective-row svg{width:13px;height:13px;fill:#ffde52;stroke:#fff7ae}.objective-row>span:first-child{align-items:center;gap:4px;overflow:hidden}.objective-row #star-goal{display:block;max-width:270px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.objective-row #score{font-size:12px;font-weight:900;color:#fff4a4;white-space:nowrap}
.board-scene{padding:22px;width:calc(var(--link-cell)*6 + 74px);max-width:100%;margin:0 auto;border:5px solid #c08a43;border-bottom:7px solid #895729;border-radius:17px;background:linear-gradient(130deg,#174d69,#0a304d);box-shadow:inset 0 0 0 2px #f0cb78,inset 0 0 12px #08253b,0 5px #62451f,0 12px 22px #0d64814d;overflow:visible}
.board-wrap{overflow:visible;direction:ltr}.board{gap:4px;grid-auto-rows:var(--link-cell);direction:ltr}.tile{height:var(--link-cell);min-height:0;padding:1px;aspect-ratio:1;border:1px solid #4c8a9a66;border-bottom:1px solid #32677f;border-radius:7px;background:linear-gradient(135deg,#164d66,#123b58);box-shadow:inset 0 1px #90d4dc0d;transition:transform .15s,background .15s}.tile:hover{transform:translateY(-1px);background:#246b7b;box-shadow:0 0 8px #8affd93d}.tile:active{transform:scale(.92)}
.animal{background-image:var(--atlas);background-size:400% 500%;background-position:var(--x) var(--y);filter:drop-shadow(0 2px 1px #04263a77)}
.tile.selected{transform:scale(1.08);z-index:2;border:2px solid #fff7a1;background:#4d8d7a;box-shadow:0 0 0 2px #ffe376a1,0 0 18px #fff17299}.tile.hinted{border-color:#fff2a5;background:#397f81;animation:link-hint .75s ease-in-out infinite}.tile.empty{background:#082d4477;border-color:#1e577055;box-shadow:none;opacity:.62}.tile.rock{padding:5px;border:0;background:none}.rock-shape{font-size:0;width:90%;height:82%;background:linear-gradient(135deg,#9ebbc1,#6e899b 55%,#3f5e75);clip-path:polygon(19% 11%,69% 0,97% 39%,90% 86%,39% 100%,0 69%,4% 32%);box-shadow:inset 7px 7px #d1e6dc}.tile.frozen:after{border-color:#a9f5ff;box-shadow:inset 0 0 7px #cdffffab,0 0 3px #d1fcff;background:linear-gradient(130deg,#e2ffff0f,#a8ecff26);border-radius:6px;color:#fff;font-size:11px}
.board-caption{position:absolute;top:calc(100% + 9px);left:-5px;right:-5px;margin:0;color:#e1ffff;text-shadow:0 1px #3a8d99;font-size:8px;min-height:16px}.connection polyline{stroke:#fff5a1;stroke-width:3.5;filter:drop-shadow(0 0 3px #8dffff) drop-shadow(0 0 6px #a5f6ff)}
.tools{max-width:360px;display:flex;justify-content:center;gap:26px;margin:30px auto 5px;padding:0;min-height:82px}.tools .tool{position:relative;flex:0 0 75px;display:flex;align-items:center;flex-direction:column;gap:6px;min-height:81px;padding:0;border:0;background:none;box-shadow:none}.prop-art{display:grid;place-items:center;width:57px;height:57px;padding:11px;border:2px solid #edffffcc;border-radius:50%;background:radial-gradient(circle at 30% 20%,#fffaffb3,#a3effd40 45%,#56bdde38);box-shadow:inset 0 -4px 3px #9bf6f750,0 3px 5px #288caa38}.prop-art svg{width:31px;height:31px;filter:drop-shadow(0 2px #ffffff66)}.hint-tool .prop-art{color:#ffd752}.shuffle-tool .prop-art{color:#83e9bd}.magic-tool .prop-art{color:#dda5fb}.prop-title{color:#fcffdf;text-shadow:0 1px 2px #408f9e;font-size:10px;font-weight:800;padding:0;line-height:1.3}.tool>b{position:absolute;inset-inline-end:2px;top:-2px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 4px;border-radius:12px;background:#73b839;border:2px solid #f8ffd7;box-shadow:0 2px #3c8e3f;font-size:11px;color:#fff}
.play-footer{max-width:400px;margin:7px auto 0;display:flex;justify-content:space-between;align-items:center;color:#edfff3;font-size:9px;gap:10px}.play-footer>span{display:flex;align-items:center;gap:4px;opacity:.9}.play-footer svg{width:11px;height:11px;fill:none}.play-footer button{display:flex;align-items:center;gap:3px;color:#fff6b1;font-size:9px;background:#398c8566;padding:5px 8px;border-radius:12px}.mobile-links{display:flex;justify-content:center;gap:13px;align-items:center;margin:12px auto 0;padding:0 12px 12px;color:#e8ffec;font-size:9px}.mobile-links button{font-size:9px;max-width:94px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-links>span{opacity:.5}
.tutorial-card{max-width:398px;margin:7px auto 10px;background:#fff6caeb;border:2px solid #f5e9a9;border-radius:14px;padding:9px 11px;box-shadow:0 3px #be9a4a33}.tutorial-card-main{gap:9px}.tutorial-card-main h2{font-size:12px}.tutorial-card-main p{font-size:9px}.tutorial-portrait{width:38px;height:38px}.tutorial-card-top{font-size:8px;margin-bottom:5px}.tutorial-skip{font-size:9px}
dialog{width:420px;max-width:calc(100vw - 26px);max-height:91dvh;border:5px solid #fff0b5;border-bottom:7px solid #bd8c43;border-radius:26px;background:linear-gradient(#fffbe9,#f8e6b6);box-shadow:0 5px #8f6532,0 20px 70px #0a496f66;color:#617e37;padding:0}dialog::backdrop{background:#07567a72;backdrop-filter:blur(3px)}.modal-body{padding:27px 23px 24px}.modal-body h2{font-size:23px;color:#548332;margin:10px 0}.modal-body p{color:#988454;font-size:11px;line-height:1.8}.modal-close{background:linear-gradient(#ffdf80,#efb558);border:2px solid #fff4c3;box-shadow:0 2px #bb8842;color:#98703b;z-index:2}.modal-decoration{color:#d5a53f}.primary-button{font-weight:900;font-size:15px;padding:13px 16px;border:3px solid #ffffcd;border-bottom:3px solid #edffb1;border-radius:17px;background:linear-gradient(#abe34e,#72bb2e);box-shadow:inset 0 2px #e4ff9c,0 5px #4c8b26;color:#fffbe0;text-shadow:0 2px #66a132;line-height:1.5}.secondary-button{font-size:12px;font-weight:800;border:2px solid #fff8dc;border-bottom:3px solid #e0b365;background:linear-gradient(#ffe9a6,#f1cf7b);color:#8d773c;box-shadow:0 2px #bf944c;border-radius:13px;padding:11px}.instructions{background:#eee8c2;color:#8e7a4d;font-size:11px;line-height:1.9}.setting-row{font-size:12px;color:#8e8053}.setting-row input{accent-color:#80b84a}.records-grid{background:#e9edbf}.toast{background:#205e68f5;color:#fcffdf;border-color:#d4ffbf;font-size:12px;z-index:99}
.link-modal-eyebrow{display:block;text-align:center;color:#b99b5d;font-weight:800;letter-spacing:2px;font-size:9px}.preview-description{text-align:center}.preview-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:13px 0;margin:10px 0;border-block:1px dashed #d7c287}.preview-metrics span{text-align:center;font-size:9px;color:#a08b54}.preview-metrics b{display:block;color:#6f963e;font-size:22px;line-height:1.5}.link-board-preview{max-width:270px;margin:17px auto 20px;padding:11px;display:grid;grid-template-columns:repeat(var(--preview-cols),minmax(0,1fr));gap:3px;background:#123e57;border:4px solid #bd8a44;border-radius:11px;direction:ltr}.preview-tile{display:block;aspect-ratio:1;background:#24566c;border:1px solid #50879455;border-radius:4px}.preview-tile.empty{opacity:.25}.preview-tile.rock{background:linear-gradient(130deg,#b3c9c5,#587d8e);border-radius:9px}.preview-tile.frozen{box-shadow:inset 0 0 0 2px #c3faff}
.animal-album{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px 7px;margin:20px 0 24px}.album-friend{position:relative;text-align:center;min-width:0}.album-friend>.animal{width:100%;aspect-ratio:1;height:auto;margin:0 auto 4px}.album-friend b{display:block;color:#796838;font-size:10px;font-weight:800}.album-friend small{display:block;font-size:8px;color:#a29162;margin-top:3px}.album-friend em{position:absolute;right:-3px;top:-3px;font-size:7px;font-weight:800;font-style:normal;background:#ffba5d;color:#fff9dc;border:1px solid #fff5cd;border-radius:8px;padding:2px 4px}
dialog.link-home-screen{width:480px;max-width:100vw;height:100dvh;max-height:100dvh;inset:0;margin:0 auto;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:auto;overscroll-behavior:contain}
dialog.link-home-screen::backdrop{background:#148fc1 url('assets/match-sky.png') center/auto 100dvh no-repeat;backdrop-filter:none}
.link-home-screen .modal-body{min-height:100dvh;max-width:440px;margin:auto;padding:23px 25px 20px;display:flex;flex-direction:column;align-items:stretch;justify-content:center}.link-home-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:auto;padding:0 2px;color:#efffe7;font-weight:900}.home-leaf{font-size:9px;letter-spacing:2px;text-shadow:0 1px #428c53}.home-star{font-size:15px;color:#fff8b6;padding:5px 14px;border:2px solid #f5d38b;border-radius:20px;background:linear-gradient(#b58341,#906033);box-shadow:0 3px #6d4e2b}
.home-logo{text-align:center;padding-top:25px}.home-logo small{font-size:12px;font-weight:900;letter-spacing:6px;color:#e5ffaf;text-shadow:0 2px #438e45}.home-logo h1{font-size:clamp(37px,10vw,47px);font-weight:1000;letter-spacing:6px;color:#fff6a5;text-shadow:0 4px #4a8d30,2px 0 #4a8d30,-2px 0 #4a8d30,0 -2px #4a8d30,0 7px 5px #087b6e40;margin:9px 0 6px;line-height:1.3}.home-logo p{color:#edfff2;font-size:12px;letter-spacing:1px;text-shadow:0 1px #3087a2;margin:9px 0}
.home-friends{height:176px;position:relative;margin:5px -10px 14px}.home-friend{position:absolute;width:95px;height:95px;bottom:11px;z-index:1;animation:link-float 4s ease-in-out infinite}.home-friend.friend-0{left:0;width:85px;height:85px;bottom:22px;transform:rotate(-13deg);animation-delay:-1s}.home-friend.friend-1{left:15%;bottom:54px;width:98px;height:98px;transform:rotate(-6deg);animation-delay:-2s}.home-friend.friend-2{left:calc(50% - 67px);width:134px;height:134px;bottom:0;z-index:3;animation-delay:-.5s}.home-friend.friend-3{right:13%;bottom:56px;width:94px;height:94px;transform:rotate(7deg);animation-delay:-2.4s}.home-friend.friend-4{right:0;bottom:20px;width:85px;height:85px;transform:rotate(13deg);animation-delay:-1.6s}.home-friend-ground{position:absolute;left:8%;right:8%;bottom:0;height:30px;border-radius:50%;background:#448f4777;filter:blur(9px)}
.home-current{position:relative;display:flex;align-items:center;gap:13px;padding:14px 15px 18px;background:linear-gradient(#fff9d3,#f6e5a6);border:4px solid #e6bb6d;border-bottom:5px solid #bd873f;border-radius:20px;box-shadow:inset 0 1px white,0 3px #996b39,0 9px 20px #137b9c38}.home-current-icon{width:58px;height:58px;flex-shrink:0}.home-current>div:nth-child(2){min-width:0;flex:1}.home-current small{font-size:9px;color:#a08d52}.home-current h2{font-size:20px;margin:3px 0;color:#70933d;line-height:1.3}.home-current h2>span{font-size:9px;display:inline-block;vertical-align:middle;margin-left:8px;font-weight:500;color:#a48d4b}.home-current p{font-size:10px;margin:5px 0 0;color:#a08f60}.home-current p b{color:#92804a;font-size:12px}.home-current-arrow{font-size:27px;color:#bf9e56}.home-save-progress{position:absolute;bottom:4px;left:15px;right:15px;height:5px;border-radius:6px;background:#d5c58d;overflow:hidden}.home-save-progress i{display:block;height:100%;background:linear-gradient(90deg,#9ada53,#69b235);border-radius:5px}
.home-continue{margin:20px 0 0;font-size:18px;padding:14px 20px;min-height:61px;border-radius:21px}.home-continue>span{font-size:14px;margin-left:14px;opacity:.8}.home-preview-link{background:none;border:0;color:#eaffec;text-shadow:0 1px #428c86;font-size:11px;font-weight:800;margin:15px auto 18px;padding:4px 15px}.home-preview-link>span{font-size:17px;margin-left:4px}.home-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;max-width:310px;width:100%;margin:0 auto}.home-shortcuts button{border:0;background:none;color:#f3ffe7;font-size:10px;padding:0;display:flex;flex-direction:column;gap:8px;align-items:center;text-shadow:0 1px #488d8f}.home-shortcuts b{display:grid;place-items:center;width:45px;height:45px;border-radius:50%;border:2px solid #f7ffea;background:linear-gradient(#c9f290b3,#78c887a1);box-shadow:inset 0 2px #faffdc99,0 3px #3c9a8c66;color:#fffce4;font-size:23px;text-shadow:0 1px #6bae64}.home-shortcuts span{line-height:1.4}.home-save-note{color:#e9fff0!important;font-size:9px!important;text-align:center;margin:auto 0 0!important;padding-top:23px;line-height:1.7!important;text-shadow:0 1px #468d8f}.home-save-note i{display:inline-block;width:5px;height:5px;border-radius:50%;background:#c3fa8a;margin-right:5px;vertical-align:middle}.home-save-note small{display:block;font-size:8px;opacity:.8;letter-spacing:1px}
@keyframes link-hint{50%{box-shadow:0 0 0 2px #fff2a5,0 0 11px #fff7a0;transform:scale(1.04)}}
@keyframes link-float{0%,100%{translate:0 0}50%{translate:0 -6px}}
@media(max-height:750px){.link-home-screen .modal-body{padding-top:15px;padding-bottom:15px}.home-logo{padding-top:14px}.home-logo h1{font-size:38px;margin-block:5px}.home-logo p{margin:6px 0;font-size:10px}.home-friends{height:139px;margin-top:0}.home-friend.friend-1,.home-friend.friend-3{bottom:37px}.home-friend.friend-2{height:114px;width:114px;left:calc(50% - 57px)}.home-current{padding-top:9px;padding-bottom:14px}.home-continue{margin-top:16px;padding-block:10px;min-height:53px}.home-preview-link{margin-block:10px}.home-shortcuts b{width:40px;height:40px}.home-save-note{padding-top:16px}}
@media(max-width:355px){.topbar{padding-inline:12px}.game-title h1{font-size:28px!important}.hud{grid-template-columns:minmax(0,1fr) 78px;gap:7px}.timer strong{font-size:19px}.tools{gap:19px}.link-home-screen .modal-body{padding-inline:19px}.home-logo h1{font-size:35px}.animal-album{gap:10px 5px}.album-friend b{font-size:9px}}
@media(prefers-reduced-motion:reduce){.home-friend,.tile.hinted{animation:none}}

.long-title .game-title h1{font-size:24px!important}.long-title .home-logo h1{font-size:32px;letter-spacing:1px}

/* Individually measured atlas bounds preserve complete faces and tall ears. */
.animal{position:relative;background:none!important}.animal:before{content:"";position:absolute;left:50%;top:50%;width:var(--frame-w,100%);height:var(--frame-h,100%);transform:translate(-50%,-50%);background-image:var(--atlas);background-size:var(--frame-sx,400%) var(--frame-sy,500%);background-position:var(--frame-x,0%) var(--frame-y,0%);background-repeat:no-repeat}
body:has(dialog.link-home-screen[open]){overflow:hidden;height:100dvh}

/* Keep the board and controls together on a phone; the title lives on the home screen. */
.game-title{display:none}.topbar{height:52px;padding-top:5px;padding-bottom:3px}.stage-row{min-height:24px;margin-bottom:10px}.level-pill{padding:3px 14px;line-height:1.2}.pause-button{width:26px;height:26px}.hud{height:76px;padding-top:10px;padding-bottom:7px}.timer{padding-block:9px}.objective-row{margin-block:6px;line-height:1.2}.objective-row #score{padding-top:0;line-height:1.2}.tools{margin-top:26px;min-height:74px}.tools .tool{min-height:74px}.prop-art{width:50px;height:50px;padding:9px}.prop-art svg{width:28px;height:28px}.play-footer{margin-top:4px;font-size:8px}.play-footer>span{font-size:8px}.play-footer button{font-size:8px;padding-block:3px}.mobile-links{margin-top:8px;padding-bottom:7px;gap:11px}.mobile-links button{font-size:8px}
html:has(dialog.link-home-screen[open]){overflow:hidden;height:100dvh}

.link-sound-preview{width:100%;margin-top:13px}.link-sound-preview[aria-pressed="true"]{background:linear-gradient(#b7e575,#8ac34c);color:#fffbe0;border-bottom-color:#72a13e}.modal-body .link-sound-note{font-size:10px;line-height:1.7;color:#8c8053;margin:10px 0}
