/* Mobile garden: preserve the original illustration's proportions and clear play hierarchy. */
:root{
  --paper:#f9fbf3;--paper-hi:#fffef8;--paper-deep:#edf3e6;
  --ink:#264f3c;--muted:#647b67;--line:#dce6d4;--green:#397e56;
  --brass:#b88b39;--brass-hi:#e7c778;--clay:#cf7762;
  --ui:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --num:"Trebuchet MS",var(--ui);--serif:var(--ui);
}
html,body{background:#e7eee1}
body{font-family:var(--ui);color:var(--ink);background:radial-gradient(ellipse at 25% 20%,#cbdcc4,transparent 65%),#e8eee1}
.shell{max-width:480px;background:var(--paper);box-shadow:0 0 44px #2f53391a}
h1,h2,h3{font-family:var(--ui);font-weight:750;letter-spacing:0}
h1{font-size:25px;line-height:1.3}
.brand-small{font:600 10px var(--ui);letter-spacing:.08em;color:#6a8569;opacity:1}
.money{min-height:44px;gap:5px;background:var(--paper-hi);border:1px solid #dfd7b5;box-shadow:0 2px 0 #d9dfc766;font:750 15px var(--num);color:var(--ink)}
.money .icon{color:#bd913c;width:20px;height:20px}
.round-button{width:44px;height:44px;border:1px solid #d7e3cc;background:#fffef3;color:#4b7953;box-shadow:0 2px 0 #d4dfc477}
.round-button .icon{width:21px;height:21px}
.primary,.secondary{min-height:46px;border-radius:14px;font:700 14px var(--ui)}
.primary{background:linear-gradient(#5b9c68,#397e56);border:1px solid #38744c;box-shadow:0 3px 0 #2f6845;color:#fffef5}
.secondary{background:#f0f5e7;border:1px solid #d5e2c9;box-shadow:0 2px 0 #d9e5cf;color:#47704f}
.text-button{min-height:44px;color:#4d7255;font-size:12px}
.subtle,.fine-print{color:#637a65;line-height:1.8}
/* One clipped atlas cell, with a uniform SVG scale. No stretched background sprite. */
.world-art{background:none!important;overflow:hidden;pointer-events:none}
.world-art>svg{display:block;width:100%;height:100%;overflow:hidden}
.map-page{background:#86a96e}
.map-top{height:calc(82px + env(safe-area-inset-top));padding:calc(10px + env(safe-area-inset-top)) 18px 9px;align-items:center;color:var(--ink);background:#f9fbf3f7;border-bottom:1px solid #d9e3cb;backdrop-filter:blur(10px);text-shadow:none}
.map-brand h1{font:800 25px/1.2 var(--ui);color:#2c5c42;margin:3px 0 0;letter-spacing:0}
.map-sub{font-size:11px;line-height:1.3;color:#6a8067;margin:3px 0 0}
.map-top .brand-small{display:block;font-size:9px;letter-spacing:.1em}
.map-top .round-button{margin-left:0}
.map-ribbon{top:calc(94px + env(safe-area-inset-top));left:12px;right:12px;display:flex;justify-content:space-between;gap:12px;padding:0;background:none;border:0;pointer-events:none}
.map-ribbon button{pointer-events:auto;display:grid;grid-template-columns:19px 1fr;column-gap:6px;align-items:center;text-align:left;max-width:62%;min-height:48px;padding:8px 11px;background:#fffef2f0;border:1px solid #ffffffe0;border-radius:15px;box-shadow:0 3px 9px #36573517;flex-wrap:initial}
.map-ribbon .icon{grid-row:span 2;width:19px;height:19px;color:#5d8b58}
.map-ribbon b{font:750 12px/1.25 var(--ui);color:#385f43}
.map-ribbon button span{font-size:10px;color:#6a8060;padding:0;line-height:1.3;margin:0;flex-basis:initial}
.map-ribbon button:first-child span{padding-left:0;line-height:1.3}
.map-scroll{inset:calc(82px + env(safe-area-inset-top)) 0 calc(72px + env(safe-area-inset-bottom));background:#8cae75}
.map-world{height:2340px;background:none;background-color:#8ead73}
.art-strips{position:absolute;inset:0;z-index:-3;display:grid;grid-template-rows:repeat(4,minmax(0,1fr))}
.art-strips>.world-art{width:100%;height:100%;min-height:0;mask-image:linear-gradient(transparent,#000 20px,#000 calc(100% - 20px),transparent)}
.world-dim{background:#3d68390a!important}
.map-world.unexplored .world-dim{background:#e7eddc38!important;backdrop-filter:none}
.chapter-sign,.map-landmark{display:none}
.map-garden-sign{display:flex;font-size:11px;color:#4c7346;background:#f8fce9dd;border:1px solid #e0e7b9;border-radius:20px}
.road{z-index:-1}
.road-edge{stroke:#9eae79;stroke-width:42;opacity:.62}
.road-fill{stroke:#f7edc9;stroke-width:34;opacity:.87}
.road-center{stroke:#d5c79c;stroke-width:2;stroke-dasharray:2 13;opacity:.5}
.level-node{width:63px;height:63px;border:3px solid #fff9e2;border-radius:50%;background:linear-gradient(#fff8dd,#e8d99d);box-shadow:0 4px 0 #b3a26c,0 7px 13px #335b3329;color:#576443}
.level-node>span{font:800 24px/1 var(--num);color:#64734b;text-shadow:none}
.level-node.locked{background:#ced8c3f2;border-color:#e8eeda;box-shadow:0 3px 0 #99ac8f}
.level-node.locked>span{color:#62765d;opacity:1;font-size:22px}
.level-node.cleared{background:linear-gradient(#ffe29b,#e6bf61);border-color:#fff8d8;box-shadow:0 4px 0 #b79a53}
.level-node.cleared>span{color:#785b2f}
.level-node.current{width:76px;height:76px;border:4px solid #fff5cf;background:linear-gradient(#91c77c,#4d995a);box-shadow:0 4px 0 #3b794b,0 0 0 5px #fff4bb5c,0 10px 20px #355d3c33}
.level-node.current>span{font:800 29px var(--num);color:#fff;text-shadow:0 1px #3d7b49}
.you-marker{top:-30px;font:700 10px var(--ui);background:#fffef2;color:#476c49;border:1px solid #ecedcc;box-shadow:0 2px 6px #34563422}
.node-stars .star{width:13px;height:13px}
.map-actions{bottom:calc(72px + env(safe-area-inset-bottom));left:0;right:0;padding:12px 20px 7px;background:linear-gradient(#f8fbf0ec,#f8fbf0);border-top:1px solid #f4f7e4;box-shadow:0 -6px 22px #456b3020;pointer-events:auto}
.play-button{width:100%;max-width:100%;min-height:58px;padding:8px 16px;border:1px solid #43824c;border-radius:21px;background:linear-gradient(#78b46b,#4d925a);box-shadow:0 4px 0 #397649;color:white;display:flex;align-items:center;justify-content:center;gap:11px;text-align:center;letter-spacing:0;font:800 23px var(--ui);text-shadow:0 1px #3f7f49}
.play-button>span{font:800 23px/1.2 var(--ui);letter-spacing:0;display:block}
.play-button small{font:500 10px/1.3 var(--ui);color:#f3ffe8;margin-top:3px;text-shadow:none}
.play-button .icon{order:0;width:25px;height:25px;padding:0;background:none;color:white;fill:#fff8db;box-shadow:none}
.map-foot{display:flex;align-items:center;justify-content:space-between;padding:5px 2px 0;font-size:10px;color:#607957;text-shadow:none}
.map-foot button{min-height:36px;padding:7px 4px;color:#4b744d;font-size:11px}
.map-tail{height:210px;background:linear-gradient(#8ead73,#789b64)}
.bottom-nav{height:calc(72px + env(safe-area-inset-bottom));padding:5px 10px calc(5px + env(safe-area-inset-bottom));background:#fffef7f7;border-top:1px solid #dce6d3}
.bottom-nav button{font:600 11px var(--ui);color:#82917a;gap:4px;border-radius:16px}
.bottom-nav .icon{width:23px;height:23px}
.bottom-nav button.active{color:#377c52;background:#eaf3df}
.bottom-nav .dot{background:#d28265}
/* Quiet, readable play surface; the colored pieces carry the focus. */
.game-page{background:radial-gradient(ellipse at 50% 30%,#fffef8,#f4f7eb);color:var(--ink);padding-top:env(safe-area-inset-top)}
.game-header{height:76px;padding:8px 18px;gap:8px}
.game-header small{font:500 10px var(--ui);letter-spacing:0;color:#6e8668}
.game-header h1{font:750 17px/1.3 var(--ui);color:#315b43;letter-spacing:0;margin-top:4px;white-space:normal}
.game-header .round-button{width:44px;height:44px;min-width:44px;min-height:44px;background:#fffef6;border-color:#d6e3cb;color:#507959}
.score-area{margin:0 24px 5px;padding-bottom:38px;align-items:center}
.score-area>div:first-child small{font-size:10px;color:#71876a;letter-spacing:0}
.score-area strong{font:800 42px/1.1 var(--num);color:#3d8457;letter-spacing:0}
.score-targets{padding:0}
#game-stars .star{width:23px;height:23px}
#star-note{font-size:10px;color:#6b8264;margin-top:4px}
.star-track{height:6px;bottom:20px;background:#dfe8d5}
.milestone em{font:600 9px var(--num);color:#718567}
.game-body{margin:0 18px;flex-shrink:0}
.tutorial-note{font:500 11px/1.6 var(--ui);color:#547349;min-height:20px;margin:0 0 6px}
.board-meta{font-size:10px;color:#6b8261;padding:0 3px 7px}
.board-meta>span{font-size:10px;color:#71866c}
.board-shell{padding:12px;border-radius:25px;background:linear-gradient(135deg,#dce8cf,#e7eddf);border:1px solid #c2d2b4;box-shadow:inset 0 2px 3px #ffffffb0,0 5px 0 #c8d7b9,0 9px 20px #50683c13}
.board-shell:before{content:none}
#board{gap:6px}
.piece{font:800 29px/1 var(--num);border-radius:11px;border:1px solid #ffffffa0;border-bottom:3px solid #00000016;box-shadow:inset 0 1px #ffffff99}
.piece[data-value="0"]{background:#ffffff0c;border-color:transparent;box-shadow:none}
.piece.connected{outline:2px solid #3b7c54;outline-offset:0}
.piece.hinted{outline:3px dashed #377d50}
.game-message{min-height:34px;margin:9px auto 0;color:#607d53;font-size:11px;line-height:1.6}
.game-tools{margin:auto 30px 5px;gap:14px}
.game-tools>button{font:600 11px var(--ui);color:#648259;gap:5px;min-height:64px}
.game-tools>button>.icon{width:46px;height:46px;padding:11px;border-radius:15px;background:#f0f5e8;border:1px solid #d3e1c7;box-shadow:0 2px 0 #d7e2cd;color:#608653}
.game-tools>button.selected>.icon{background:#dcecd0;border-color:#87ac78}
.game-save{font-size:9px;letter-spacing:0;color:#7a8d70;min-height:20px;margin-bottom:calc(5px + env(safe-area-inset-bottom))}
.preview-layer{background:#f5faedeb;border:1px solid #b0c89e;border-radius:18px}
/* Garden collections: horizontally scrollable island tabs and unwarped details. */
.page-header{height:calc(94px + env(safe-area-inset-top));padding:calc(13px + env(safe-area-inset-top)) 18px 10px;background:var(--paper);border-bottom:1px solid #e0e8d6}
.page-header h1{font:750 25px/1.25 var(--ui);margin-top:3px}
.page-header p{font-size:11px;color:#6a8063;line-height:1.5;margin-top:3px}
.page-scroll{inset:calc(94px + env(safe-area-inset-top)) 0 calc(72px + env(safe-area-inset-bottom));padding:16px 18px 24px}
.chapter-tabs{display:flex;gap:7px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;margin:0 -2px 15px;padding:2px 2px 5px;border:0}
.chapter-tabs::-webkit-scrollbar{display:none}
.chapter-tabs button{flex:0 0 auto;min-width:76px;min-height:44px;padding:9px 12px;border-radius:15px;border:1px solid #dbe6d0;background:#f0f5e8;font:600 12px var(--ui);color:#6e8366;white-space:nowrap}
.chapter-tabs button.active{background:#457f58;color:white;border-color:#457f58}
.garden-hero{height:222px;border-radius:22px;margin:0 0 15px;box-shadow:0 5px 15px #3f62351a;isolation:isolate}
.garden-hero>.world-art,.daily-hero>.world-art,.postcard>.world-art,.chapter-choice>.world-art{position:absolute;inset:0;height:100%;width:100%}
.garden-overlay{inset:auto 0 0;padding:36px 16px 14px;background:linear-gradient(transparent,#244a36e0);color:white}
.garden-overlay small{font-size:10px;color:#f1f6d8;letter-spacing:0}
.garden-overlay h2{font:750 23px var(--ui);margin:4px 0}
.garden-overlay p{font-size:11px;color:#f1f7e6}
.leaf-balance{position:absolute;top:-70px;right:12px;font-size:11px;background:#fffdeced;color:#426843;border:1px solid #fff9d9;box-shadow:0 2px 5px #31553b1a;padding:8px 11px}
.scene-list{display:flex;flex-direction:column;gap:0;border-top:1px solid #e1e9d7}
.scene-card{display:grid;grid-template-columns:96px 1fr;gap:15px;align-items:center;min-height:132px;padding:14px 0;border-bottom:1px solid #e1e9d7}
.scene-window{width:96px;height:112px;min-height:0;border-radius:16px;max-width:100%;flex-shrink:0}
.scene-window>.world-art{position:absolute;inset:0;top:0;width:100%;height:100%}
.scene-card.unbuilt .scene-window{filter:saturate(.65);opacity:.85}
.scene-card.built .scene-window{border:2px solid #e1c98e}
.scene-copy{align-items:flex-start;min-width:0}
.scene-copy small{font-size:10px;color:#6a8063;letter-spacing:0}
.scene-copy h3{font:750 18px var(--ui);margin:3px 0}
.scene-copy p{font-size:11px;color:#687c60;line-height:1.6;margin-bottom:8px}
.scene-copy button{min-height:44px;font-size:12px;border-radius:12px;padding:9px 13px}
.daily-hero{height:166px;border-radius:20px;isolation:isolate}
.daily-days button{min-width:44px;min-height:44px;font-size:11px}
.daily-card{border-radius:18px}
.daily-card-copy>b{font-family:var(--ui);font-size:17px}
.daily-card-copy>small,.daily-card-copy em{font-size:11px}
.daily-art{width:82px;flex-shrink:0}
.rank-entry,.shop-item,.profile-stats,.postcard{border-radius:17px}
.shop-item>b{font-family:var(--ui)}
.section-heading{gap:10px;flex-wrap:wrap}
.section-heading h2{font-family:var(--ui);font-size:19px}
.section-heading>span{font-size:10px;color:#708369;line-height:1.5}
.modal{border:1px solid #d5e1c8;border-radius:24px;background:#fffef8;box-shadow:0 18px 70px #163d3450;padding:29px 23px 23px;max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto}
.modal h2{font-family:var(--ui);font-size:24px;line-height:1.4}
.modal>p{font-size:13px;color:#62765a;line-height:1.8}
.modal-x{width:44px;height:44px;right:8px;top:8px;background:#eff4e7;border-radius:50%}
.ending-score strong{font-family:var(--num);color:#3c7f53}
.input{border-radius:13px}
.settings-links button{min-height:48px}
@media(max-width:360px){
 .map-top{padding-left:13px;padding-right:13px;gap:7px}.map-brand h1{font-size:23px}.map-sub{font-size:10px}.money{padding:5px 10px;font-size:14px}.map-ribbon{left:10px;right:10px;gap:8px}.map-ribbon button{padding:7px 9px}.map-ribbon b{font-size:11px}.map-ribbon button span{font-size:9px}.map-actions{padding:10px 14px 6px}.play-button>span{font-size:21px}.game-header{padding-left:12px;padding-right:12px}.game-header h1{font-size:15px}.game-body{margin-left:12px;margin-right:12px}.score-area{margin-left:18px;margin-right:18px}.piece{font-size:25px}.scene-card{grid-template-columns:82px 1fr;gap:12px}.scene-window{width:82px;height:102px}
}
@media(max-height:740px){
 .game-header{height:58px;padding-top:5px;padding-bottom:5px}.score-area{margin-top:0;margin-bottom:2px;padding-bottom:27px}.score-area strong{font-size:34px}.star-track{bottom:16px}.score-area>div:first-child small{font-size:9px}.milestone em{font-size:8px}.game-body{width:calc(100% - 24px);max-width:min(390px,calc(100dvh - 275px));margin:0 auto}.tutorial-note{font-size:10px;min-height:17px;margin-bottom:4px}.board-meta{padding-bottom:5px;font-size:9px}.board-meta>span{font-size:9px}.board-shell{padding:9px;border-radius:20px}#board{gap:5px}.piece{font-size:25px;border-radius:9px}.game-message{min-height:26px;margin-top:5px;font-size:10px}.game-tools{margin:5px 20px 3px;gap:10px}.game-tools>button{min-height:58px;font-size:10px;gap:4px}.game-tools>button>.icon{width:44px;height:44px;padding:10px}.game-save{min-height:16px;font-size:8px;margin-bottom:calc(3px + env(safe-area-inset-bottom))}
}
@media(min-width:900px){.shell{max-width:480px;height:min(960px,calc(100dvh - 32px));margin:16px auto;border:1px solid #d8e3cc;border-radius:25px}.map-page,.game-page{max-width:480px}}
@media(prefers-reduced-motion:reduce){.art-strips,.world-art{scroll-behavior:auto}}
@media(max-height:620px){
 .game-header{height:54px}.score-area{padding-bottom:24px}.score-area>div:first-child{display:flex;align-items:baseline;gap:7px}.score-area>div:first-child>small{margin:0}.score-area strong{font-size:32px}#star-note{display:none}.game-message{min-height:22px}.game-tools>button{padding:0}
}
.map-foot button{background:#e9f0de;border-radius:12px;min-height:40px;padding:8px 11px;color:#4e744a}
@media(min-width:600px) and (max-height:500px){
 .map-top{height:62px;padding-top:6px;padding-bottom:6px}.map-brand h1{font-size:21px}.map-sub{display:none}.map-ribbon{top:70px}.map-ribbon button{min-height:42px}.map-scroll{top:62px;bottom:60px}.map-actions{bottom:60px;padding:7px 20px 9px}.play-button{min-height:46px}.play-button>span{font-size:19px}.map-foot{display:none}.bottom-nav{height:60px;padding:3px 10px}.bottom-nav button{font-size:10px}.bottom-nav .icon{width:21px;height:21px}
 .game-page{display:grid;max-width:900px;height:100dvh;margin:0 auto;padding:8px 18px;grid-template-columns:minmax(240px,1fr) minmax(240px,1fr);grid-template-rows:62px minmax(0,1fr) 72px 22px;column-gap:18px;border-radius:0}
 .game-header{grid-column:2;grid-row:1;width:100%;height:58px;padding:2px 0}.game-header h1{font-size:16px}.score-area{grid-column:2;grid-row:2;margin:10px 7px 0;align-self:start;padding-bottom:30px}.score-area strong{font-size:40px}.score-area>div:first-child{display:block}#star-note{display:block}.game-body{grid-column:1;grid-row:1 / 5;width:min(100%,calc(100dvh - 100px));max-width:none;margin:auto;align-self:center}.game-tools{grid-column:2;grid-row:3;margin:0 8px;align-self:end}.game-tools>button{min-height:62px}.game-save{grid-column:2;grid-row:4;margin:3px 0 0;min-height:16px}
}
/* Preview shares the board's exact padding and gap at every size. */
.preview-layer{inset:12px;gap:6px}
@media(max-height:740px){.preview-layer{inset:9px;gap:5px}}
.preview-layer{border:0;box-shadow:inset 0 0 0 1px #b0c89e}
.clear-decoration{position:absolute;inset:0;pointer-events:none;z-index:4;border-radius:inherit;overflow:hidden}
.clear-petal{position:absolute;width:7px;height:7px;border-radius:80% 15% 80% 15%;background:#78bc80;opacity:0}
.clear-decoration[data-tier="2"] .clear-petal{background:#e4b34e}
.clear-decoration[data-tier="3"] .clear-petal{background:#ef9caa}
.clear-ring{position:absolute;inset:1px;border:2px solid #d9b960;border-radius:inherit;opacity:0}
/* Clear scores use the existing status line, leaving all tiles unobstructed. */
.board-shell .gain-burst{display:none}
