:root{font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;color:#24483e;background:#f3f1e8;font-synthesis:none;--ink:#24483e;--muted:#7b8b80;--green:#245647;--line:#dedfd3;--paper:#faf9f2;--gold:#d6a959}*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.4}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #d7a657;outline-offset:4px}button{transition:background .18s,transform .15s,box-shadow .15s}button:hover:not(:disabled){filter:brightness(.97)}button:active:not(:disabled){transform:translateY(1px)}.shell{max-width:1320px;margin:auto;padding:0 46px}.topbar{height:100px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--ink);font-weight:850;letter-spacing:1.1px;font-size:15px}.brand small{display:block;font-size:9px;letter-spacing:3.5px;margin-top:5px;color:#809080}.brandmark{width:43px;height:43px;border-radius:15px 15px 18px 18px;background:#285247;color:#f0dba6;display:grid;place-items:center;font-size:25px;font-family:Georgia,serif;box-shadow:inset 0 -4px #173d35}.top-actions{display:flex;gap:13px;align-items:center}.prototype{font-size:10px;letter-spacing:1.6px;color:#8b927f;border:1px solid var(--line);padding:7px 10px;border-radius:30px}.quiet{background:transparent;border:0;font-size:12px;padding:8px}.layout{display:grid;grid-template-columns:minmax(200px,1fr) 420px minmax(210px,1fr);gap:34px;align-items:start;padding:35px 0 32px}.left-panel{padding-top:15px}.eyebrow{font-size:10px;letter-spacing:2.5px;font-weight:700;color:#8c987f}h1{font-family:Georgia,"Microsoft YaHei",serif;font-weight:500;font-size:43px;line-height:1.2;letter-spacing:-1.5px;margin:16px 0}h1 em{font-style:normal;color:#7c947a}.lead{font-size:13px;line-height:1.9;color:#7a887c;max-width:250px;margin-bottom:28px}.card{background:rgba(255,255,255,.43);border:1px solid var(--line);border-radius:17px;padding:18px;margin-bottom:17px}.section-title{font-size:11px;letter-spacing:.7px;font-weight:700;display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.muted{color:#8c988c;font-size:10px}.journey p{font-size:11px;line-height:1.7;color:#819080;margin:13px 0 0}.milestones{display:flex;justify-content:space-between;font-size:11px;color:#8e9b88}.milestones b{color:#b99a61}.progress{height:5px;background:#e3e6d8;border-radius:6px;margin-top:9px;overflow:hidden}.progress>div{height:100%;background:#728e67;transition:width .5s}.legend-item{display:flex;gap:10px;align-items:center;margin:12px 0}.legend-item svg{width:37px;height:37px}.legend-item strong{display:block;font-size:12px}.legend-item small{display:block;font-size:10px;color:#899282;margin-top:4px}.local-note{font-size:11px;color:#6e8b75;display:flex;gap:8px;align-items:center;margin:22px 0 10px}.status-dot{width:6px;height:6px;background:#7d9f72;border-radius:50%}.disclaimer{font-size:10px;line-height:1.8;color:#939b8f}.game-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.phase-label{color:#84937c;font-size:10px;letter-spacing:2px;font-weight:700}h2{margin:6px 0 0;font-size:23px;letter-spacing:-.7px}.speed{border:1px solid #d6ddcc;background:#e9eddc;border-radius:50%;width:40px;height:40px;font-size:13px}.stats{display:grid;grid-template-columns:repeat(3,1fr);padding:14px 0;border:1px solid #daddca;border-radius:16px;background:#ebeeda;margin-bottom:14px}.stats>div{text-align:center;border-right:1px solid #d5ddc7}.stats>div:last-child{border:0}.stats span{display:block;font-size:10px;color:#7d8d76;margin-bottom:4px}.stats strong{font-family:Georgia,serif;font-size:25px;color:#365b43;font-weight:500}.stats strong small{font-family:inherit;font-size:12px;color:#8c9d7c}.stage{width:100%;aspect-ratio:420/610;position:relative;isolation:isolate;touch-action:none;border-radius:28px;box-shadow:0 12px 36px #214c3812,inset 0 0 0 1px #72917820;overflow:hidden;background:#b7ccb0}.scenery{position:absolute;inset:0;z-index:0;transition:filter 1s}.scenery>svg{width:100%;height:100%;display:block}.stage.night .scenery{filter:brightness(.42) saturate(.7) hue-rotate(30deg)}.board{display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(6,1fr);position:absolute;left:5.7143%;top:17.7049%;width:88.5714%;height:60.9836%;padding:3px;gap:3px;background:#71876b;border:4px solid #74826a;border-radius:15px;box-shadow:0 5px #58725b,0 9px 15px #45634830;z-index:1}.tile{position:relative;border:0;border-radius:7px;background:#f2eed8;padding:3px;min-width:0;box-shadow:inset 0 -3px #b9bb9b55;transition:background .15s,box-shadow .15s,filter .6s;touch-action:none}.tile:nth-child(12n+2),.tile:nth-child(12n+4),.tile:nth-child(12n+6),.tile:nth-child(12n+7),.tile:nth-child(12n+9),.tile:nth-child(12n+11){background:#e6e6cb}.tile.creature{background:#e0ead0}.tile svg{display:block;width:100%;height:100%;pointer-events:none}.tile.selected{background:#fff2bb!important;box-shadow:inset 0 0 0 3px #b58b43,0 0 0 2px #f8e2a8;z-index:3}.tier{position:absolute;bottom:2px;right:3px;color:#5f765f;letter-spacing:-1px;font-size:8px;font-weight:900;pointer-events:none}.tile.merged{animation:pop .55s ease}.tile:disabled{opacity:1}.stage.night .tile{filter:brightness(.67) saturate(.75)}.stage.night .tile.creature{filter:brightness(.95);box-shadow:inset 0 -2px #648c6b55}.stage.night .board{background:#354f49;border-color:#354f49;box-shadow:0 5px #203f39}.stage canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4}.guard{position:absolute;top:9.1%;width:10.6%;height:7.3%;z-index:2;border-radius:50%;border:2px solid #aaa587;background:#ddd6b5;color:#8d967a;font-size:20px}.guard svg{width:100%;height:100%;display:block}.guard-left{left:5%}.guard-right{right:5%}.gate-caption{position:absolute;top:82%;width:100%;text-align:center;font-size:10px;letter-spacing:1.4px;color:#66836e;z-index:2}.stage.night .gate-caption{color:#b1cab8}.stage-badge{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);font-size:9px;letter-spacing:1px;color:#44644d;background:#e1e8cd99;padding:5px 9px;border-radius:20px;white-space:nowrap}.battle-report{position:absolute;inset:0;background:#153f35b8;display:flex;align-items:center;justify-content:center;flex-direction:column;z-index:5;color:#fff2cd;text-align:center;padding:30px;backdrop-filter:blur(3px)}.battle-report[hidden]{display:none}.battle-report h3{font-family:Georgia,"Microsoft YaHei",serif;font-size:30px;margin:0 0 10px}.battle-report p{font-size:13px;line-height:1.7;max-width:250px}.battle-report button{margin:6px 0;min-width:180px}.hint{min-height:46px;margin:12px 3px 6px;font-size:12px;line-height:1.7;color:#798570}.tools{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.tools button{border:1px solid #dbdece;border-radius:12px;background:#f9f7ed;display:flex;flex-direction:column;align-items:center;padding:12px 4px;gap:5px}.tools button.active{border-color:#c7a15c;background:#fff0c9}.tool-symbol{font-size:22px;color:#b39157;font-family:Georgia,serif;height:26px}.tools strong{font-size:11px;font-weight:600}.tools small{font-size:9px;color:#8c9684}.primary-row{display:flex;gap:9px;margin-top:12px}.primary,.secondary{border-radius:11px;padding:12px 16px;border:0;font-size:12px;font-weight:600}.primary{background:#285545;color:#fcf2d8;box-shadow:0 3px #183f34}.primary-row .primary{flex:1}.secondary{background:#e6e9dc;border:1px solid #d3dbc9;color:#607657}.right-panel{padding-top:6px}.selection{min-height:214px;text-align:center}.selection .section-title{text-align:left}#selectedPiece{width:76px;height:76px;display:grid;place-items:center;margin:0 auto 7px}#selectedPiece svg{width:100%}#selectedInfo{font-size:12px;line-height:1.7;min-height:43px}#selectedInfo small{display:block;color:#899481;font-size:10px}.selection button{width:100%;margin-top:12px}.chest-row{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e5d9;padding:7px 0;font-size:11px}.chest-row:last-child{border:0}.chest-row>span{display:flex;align-items:center;gap:8px}.chest-row svg{width:31px;height:31px}.chest-row strong{font-family:Georgia,serif;font-size:18px;font-weight:500}.small-note{font-size:10px;color:#929b89;line-height:1.6;margin:10px 0 0}.log-card{min-height:140px}#log{font-size:11px;line-height:1.8;color:#83917d}.log-item{padding:5px 0;border-bottom:1px solid #e6e7da}.log-item:last-child{border:0}.record{display:grid;grid-template-columns:1fr auto;gap:7px;font-size:11px;margin:20px 6px;color:#73876e}.record strong{font-family:Georgia,serif;font-size:22px;font-weight:500;color:#415e42}.record small{grid-column:1/-1;line-height:1.7;color:#929c88}.research{font-size:10px;color:#8c9784;border-top:1px solid var(--line);padding-top:13px}.research summary{cursor:pointer}.research p{line-height:1.6}.research button{display:block;width:100%;margin:7px 0;font-size:10px}.text-button{background:none;border:0;font-size:11px;color:#8c9784;margin:15px 0;padding:0;text-decoration:underline;text-underline-offset:4px}footer{padding:20px 0 25px;display:flex;justify-content:space-between;border-top:1px solid var(--line);font-size:9px;color:#9a9e90;letter-spacing:1px}.color-picker{display:flex;gap:7px;justify-content:center;padding:8px}.color-picker[hidden]{display:none}.color-picker button{border:1px solid #ccd8c3;background:#f9f8ef;border-radius:10px;padding:5px;width:65px;font-size:10px}.color-picker svg{height:35px;width:35px;display:block;margin:auto}dialog{border:1px solid #d9ddcd;border-radius:22px;background:#f7f5e9;color:#315042;padding:0;width:min(460px,calc(100% - 32px));box-shadow:0 25px 100px #122e3940}dialog::backdrop{background:#173d3777;backdrop-filter:blur(5px)}.modal-inner{position:relative;padding:34px}.modal-close{position:absolute;right:16px;top:12px;border:0;background:none;font-size:25px;color:#7b8e78}.modal-inner h2{font-family:Georgia,"Microsoft YaHei",serif;font-size:27px;margin:14px 0}.modal-inner p,.modal-inner li{font-size:13px;line-height:1.9;color:#7b8876}.modal-inner ul{padding-left:20px}#modalActions{display:flex;gap:10px;margin-top:20px;flex-wrap:wrap}@keyframes pop{0%{transform:scale(.8);background:#fff1a7}55%{transform:scale(1.08)}100%{transform:scale(1)}}
@media(min-width:1500px){.layout{gap:45px}.shell{max-width:1400px}.left-panel{padding-top:25px}}
@media(max-width:1120px){.shell{padding:0 25px}.layout{grid-template-columns:minmax(155px,1fr) 390px minmax(180px,1fr);gap:20px}h1{font-size:35px}.card{padding:14px}.lead{font-size:12px}}
@media(max-width:940px){.layout{grid-template-columns:minmax(340px,420px) minmax(200px,260px);justify-content:center}.left-panel{display:none}.topbar{height:75px}}
@media(max-width:650px){.shell{padding:0 15px}.topbar{height:65px}.brand{font-size:11px;gap:8px}.brandmark{height:34px;width:34px;border-radius:11px;font-size:21px}.brand small{font-size:7px;letter-spacing:2.2px}.top-actions{gap:4px}.prototype{display:none}.layout{display:block;padding-top:19px}.game-column{max-width:420px;margin:auto}.right-panel{max-width:420px;margin:24px auto 0;display:grid;grid-template-columns:1fr 1fr;gap:12px}.right-panel .card{margin:0}.selection{min-height:0}.log-card{grid-column:1/-1;min-height:0}.record{grid-column:1/-1;margin:5px}.research{grid-column:1/-1}.text-button{grid-column:1/-1;text-align:left}.stage{border-radius:22px}.stats{padding:10px 0}.game-header{margin-bottom:10px}h2{font-size:20px}.stats strong{font-size:23px}.hint{font-size:11px}.tools button{padding:10px 3px}.primary,.secondary{padding:12px}footer{font-size:8px;gap:15px;line-height:1.7}.game-column .primary-row{position:relative}.tier{font-size:7px}.gate-caption{font-size:9px}}

/* Motion keeps board identity visible throughout each cascade. */
.tile{user-select:none;-webkit-user-select:none}.tile.merged{animation:none}.tile.drag-source{opacity:.22}.tile.drop-target{box-shadow:inset 0 0 0 3px #d7a657}.drag-ghost{position:fixed!important;z-index:9999;pointer-events:none;transform:translate(-50%,-50%) scale(1.12)!important;box-shadow:0 10px 18px #173c3866!important;opacity:.96}.tier{font-size:10px!important;letter-spacing:0;background:#183e38;color:#fff5d3;padding:1px 4px;border-radius:4px;bottom:1px;right:1px}.animating .board{pointer-events:none}.animating .tile{transition:none}.animating .tools,.animating .primary-row{pointer-events:none;opacity:.65}.stage{transition:background 1s}

.swap-preview{transition:transform .18s ease!important;z-index:3}.gate-caption.boss-warning{top:79.5%;left:2%;width:96%;padding:6px 8px;color:#a2372a;background:#fff0d9ed;border:1px solid #d58b72;border-radius:9px;font-size:11px;font-weight:700;letter-spacing:0}.drag-ghost{filter:drop-shadow(0 8px 6px #163a3840)}

.stats{grid-template-columns:repeat(2,1fr)}.camp-hearts{position:absolute;top:10.2%;left:35%;width:30%;display:grid;grid-template-columns:repeat(5,1fr);gap:0 3px;z-index:3;pointer-events:none;background:#fcf3d2dd;border-radius:9px;padding:3px 7px;line-height:1.05}.camp-hearts span{font-size:18px;text-align:center;text-shadow:0 1px #7e3e4c}.camp-hearts .full{color:#e6758d}.camp-hearts .empty{color:#a4aaa0;opacity:.45}.flying-reward{position:fixed;z-index:10000;pointer-events:none;color:#ffe9a0;font-size:30px;font-weight:900;text-shadow:0 2px 3px #275546,-1px -1px #275546,1px -1px #275546;white-space:nowrap}.flying-reward small{display:block;font-size:11px;text-align:center}.flying-reward.healing{color:#f17b98}.stage.night .camp-hearts{background:#193f3be6}.drag-ghost{transform:translate(-50%,-50%) scale(1.06)!important}@media(max-width:650px){.camp-hearts span{font-size:16px}}

:root{--pig-atlas:var(--texture-pig-atlas);--treasury-atlas:var(--texture-treasury-atlas);--house-atlas:var(--texture-house-atlas);--backdrop:var(--texture-backdrop-forest);--frame:#b28549;--tile:#fff4dc;--trim:#71835e;--house-x:0%;--button:#f7dfac}
body[data-skin="orchard"]{--backdrop:var(--texture-backdrop-orchard);--frame:#b8754c;--tile:#fff3e4;--trim:#a28e65;--house-x:50%;--button:#f7ddc7}
body[data-skin="dusk"]{--backdrop:var(--texture-backdrop-dusk);--frame:#687e88;--tile:#f0f4ee;--trim:#719594;--house-x:100%;--button:#d7e8e6}
*{box-sizing:border-box}body{background:#d9e4cf;color:#304936}.shell{max-width:460px;padding:0 10px;margin:auto}.topbar{height:42px;border:0;gap:4px}.brand{font-size:10px;letter-spacing:0}.brandmark,.brand small,.prototype,footer,.left-panel,.right-panel,.hint,.stats,.phase-label,.stage-badge,.tools small,.tools strong{display:none!important}.top-actions{gap:0}.top-actions button{padding:6px;min-width:32px;min-height:32px}.layout{display:block;padding:0}.game-column{max-width:440px;margin:auto}.game-header{margin:0;height:45px;padding:0 6px}.game-header h2{font:800 16px system-ui;margin:0}.move-pill{display:flex;align-items:center;gap:8px;background:#fff6df;border:1px solid #bc9962;border-radius:16px;padding:5px 13px;font-size:14px;font-weight:800}.move-pill strong{font-size:21px}.speed{width:38px;height:34px;border-radius:12px;background:var(--button)}.stage{aspect-ratio:420/610;border-radius:20px;background:#b2c99c;box-shadow:0 4px 20px #283d2922;overflow:hidden}.scenery{filter:none!important}.landscape{position:absolute;inset:0;background-image:var(--backdrop);background-size:cover;background-position:center;transition:filter .8s}.stage.night .landscape{filter:brightness(.56) saturate(.65)}.houseplate{position:absolute;left:0;top:-6%;width:100%;height:27%;background-image:var(--house-atlas);background-size:300% 100%;background-position:var(--house-x) center;transform-origin:center bottom;transition:filter .5s}.houseplate.house-bump{animation:houseBump .6s ease}.stage.night .houseplate{filter:brightness(.75)}.board{padding:3px;gap:2px;border:3px solid var(--frame);background:var(--trim);border-radius:12px;box-shadow:0 3px 0 #715d3a55;overflow:hidden}.tile,.tile.creature,.tile:nth-child(n){background:var(--tile);border-radius:5px;padding:0;box-shadow:inset 0 -2px 3px #b7a68122;overflow:hidden}.tile.selected{box-shadow:inset 0 0 0 2px #c79a4c;background:#fff7d8!important}.tier{display:none!important}.pig-visual{display:block;position:absolute;inset:0;pointer-events:none;transform:scale(var(--art-scale));transform-origin:50% 75%}.pig-turn{display:block;position:absolute;inset:0;transform:scaleX(var(--face,1));transition:transform .15s ease}.sprite{display:block;position:absolute;inset:0;background-repeat:no-repeat;pointer-events:none}.sprite.element{background-image:var(--pig-atlas);background-size:500% 400%}.sprite.treasury{background-image:var(--treasury-atlas);background-size:500% 166.6667%;background-position-y:50%!important}.creature:not(.drag-source) .pig-visual{animation:breathe 3.8s ease-in-out infinite;animation-delay:var(--idle-delay,0s)}.tile:nth-child(4n+1){--idle-delay:-.8s}.tile:nth-child(4n+2){--idle-delay:-1.7s}.tile:nth-child(4n+3){--idle-delay:-2.6s}.animating .pig-visual,.drag-ghost .pig-visual,.drag-source .pig-visual{animation:none!important}.guard{border:0;background:none;border-radius:0;width:14%;height:9.65%;top:4.9%;font-size:18px;color:#8b7460;box-shadow:none}.guard-left{left:1.5%}.guard-right{right:1.5%}.guard .pig-visual{--art-scale:.9!important;animation:breathe 4.7s ease-in-out infinite}.camp-hearts{top:10.1%;left:37%;width:26%;background:#fff2dddc;padding:2px 4px;border:1px solid #e0bf8e;border-radius:8px;gap:0 2px}.camp-hearts span{font-size:14px}.stage.night .camp-hearts{background:#d9dbccdf}.stage.night .tile{filter:brightness(.83)}.stage.night .tile.creature{filter:brightness(1)}.stage.night .tile.ice-active{background:#c1e9f5;box-shadow:inset 0 0 10px #71c7eccc}.ice-active:after{content:'';position:absolute;inset:5%;border-radius:8px;border:1px solid #c9f7ff;box-shadow:inset 0 0 8px #6bbde766;pointer-events:none;opacity:var(--ice-opacity,.5)}.gate-caption{font-size:9px;top:83%;letter-spacing:0}.gate-caption.boss-warning{font-size:10px;top:79.5%;padding:4px;white-space:normal}.tools{display:inline-grid;width:67%;gap:6px;margin-top:8px}.tools button{padding:5px;border:2px solid var(--frame);border-radius:16px;background:linear-gradient(#fff9ed,var(--button));box-shadow:inset 0 2px white,0 3px #6d5b3a33;min-height:48px}.tool-symbol{font-size:25px;height:31px;display:block}.primary-row{float:right;width:30%;margin-top:8px}.primary-row #pause{display:none}.primary-row .primary{padding:5px;font-size:11px;min-height:48px;border-radius:16px;background:#5e695b;color:white;box-shadow:0 3px #354632}.battle-report{backdrop-filter:blur(2px)}.skin-picker{border:1px solid #a8b598;border-radius:8px;background:#ffffffa8;color:#334b39;max-width:86px;padding:5px;font-size:11px}.sound-button{font-size:12px}.chimney-smoke{position:absolute;left:65%;top:0;width:20px;height:28px;pointer-events:none}.chimney-smoke i{position:absolute;left:0;bottom:0;width:10px;height:10px;background:#fff9;border-radius:50%;animation:smoke 4s linear infinite}.chimney-smoke i:nth-child(2){animation-delay:-1.3s}.chimney-smoke i:nth-child(3){animation-delay:-2.6s}.paused-motion *,.paused-motion .pig-visual{animation-play-state:paused!important}.hatch-ring{position:absolute;inset:4%;border:2px solid #ffe7a4;border-radius:50%;animation:hatch .42s ease-out forwards;pointer-events:none}.stage .test-toolbar{position:absolute;z-index:8}.qa-panel{margin:16px 0;padding:12px;background:#fff6df;border-radius:12px;font-size:12px;clear:both}.qa-panel button,.qa-panel input{margin:4px;padding:6px}.qa-panel[hidden]{display:none}.mini-notice{font-size:10px;text-align:center;color:#596c58;clear:both;padding-top:12px}.modal-inner{padding:23px}.modal-inner h2{font-size:22px}#modalBody{font-size:13px}.lobby{position:fixed;inset:0;background:#e5ecd9;z-index:100;overflow:auto;padding:18px max(16px,calc((100vw - 430px)/2));background-image:var(--backdrop);background-size:cover;background-position:center}.lobby[hidden]{display:none}.lobby h1{font:800 28px system-ui;margin:12px 0;color:#35533d}.lobby p{font-size:12px;color:#4d6656}.lobby-card{padding:14px;border:1px solid #bbbc9e;border-radius:18px;background:#fff9e9ee;margin:12px 0}.lobby-card button{border:0;border-radius:10px;background:#f2dfba;padding:9px 12px;margin:4px}.lobby select,.lobby input{width:100%;padding:11px;border:1px solid #b3b79c;border-radius:10px;margin:5px 0;background:#fffdf5}.lobby .start{width:100%;padding:16px;background:#396d4d;color:white;font-size:17px;border:0;border-radius:15px;font-weight:bold}.honor-pig{position:relative;width:72px;height:72px;margin:auto}.honor-list{display:flex;gap:12px;justify-content:center;text-align:center;font-size:11px}.tier-title{font-weight:bold}.lobby small{font-size:10px;color:#617160}.breadcrumb{font-size:12px;font-weight:bold}.rank-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid #ded9c2}.lobby-close{float:right}.low-motion .pig-visual,.low-motion .chimney-smoke i{animation:none!important}@keyframes breathe{0%,100%{transform:scale(var(--art-scale)) translateY(0) rotate(-.5deg)}50%{transform:scale(var(--art-scale)) translateY(-1.2px) rotate(.5deg)}}@keyframes smoke{from{transform:translate(0,0) scale(.5);opacity:.35}to{transform:translate(8px,-25px) scale(1.7);opacity:0}}@keyframes hatch{from{transform:scale(.5);opacity:1}to{transform:scale(1.2);opacity:0}}@keyframes houseBump{40%{transform:scale(1.025)}100%{transform:scale(1)}}@media(prefers-reduced-motion:reduce){.pig-visual,.chimney-smoke i{animation:none!important}.pig-turn{transition:none}}@media(max-width:370px){.shell{padding:0 5px}.topbar{height:35px}.brand{font-size:9px}.camp-hearts span{font-size:12px}.top-actions button{font-size:10px}.game-header{height:39px}}@media(min-width:650px){.shell{padding:0 10px}.topbar{height:42px}.layout{display:block}.game-column{max-width:440px}}
.guard{top:1.8%}.guard-left{left:4%}.guard-right{right:4%}.color-picker button{height:50px;position:relative;color:transparent}.color-picker .pig-visual{--art-scale:.75!important}.tool-symbol svg{filter:drop-shadow(0 2px 1px #8d7c5133)}

/* Scene coordinates remain aligned with combat's 420 by 610 logical canvas. */
html{min-height:100%;background:#26372d}body{min-height:100vh;background:radial-gradient(ellipse at top,#526c4b,#26372d 75%)}
.shell{padding:0 8px 14px;max-width:456px}.topbar{height:30px;color:#eaf2db}.brand{color:#eaf2db}.top-actions button{color:#eaf2db}.top-actions{gap:2px}.skin-picker{max-width:78px;padding:3px}
.stage{border-radius:19px;box-shadow:0 12px 34px #0d1c2780;background:#92b566}.landscape{background-position:center;background-size:100% 100%}
.stage .game-header{position:absolute;left:3%;right:3%;top:.8%;height:6%;z-index:6;padding:0;gap:6px}
.game-header h2,.move-pill,.speed,.header-pause{background:linear-gradient(#b7732d,#8d491d);border:2px solid #f2bf70;box-shadow:inset 0 2px #ffdc8c,inset 0 -3px #663614,0 2px 2px #583f3266;color:#fff7d9;border-radius:15px;text-shadow:0 2px #603a22;font-family:system-ui;font-weight:850}
.game-header h2{font-size:15px;padding:3px 8px;letter-spacing:0}.move-pill{margin:auto;font-size:17px;padding:1px 13px;min-width:82px;justify-content:center}.move-pill strong{font-size:22px}.speed,.header-pause{height:31px;width:38px;font-size:15px;padding:0}.header-pause{min-width:34px}
.houseplate{top:5%;height:23%;left:-4%;width:108%}.camp-hearts{top:10.4%;left:37.5%;width:25%;background:transparent;border:0;padding:0;gap:0 1px}.camp-hearts span{font-size:16px;line-height:1.05;text-shadow:0 2px 1px #86372f}.camp-hearts .full{color:#ed334b}.camp-hearts .empty{color:#a66552;opacity:.55}
.guard{top:8.5%;width:14%;height:9.65%}.guard-left{left:10%}.guard-right{right:10%}.guard:empty{visibility:hidden}
.board{border:4px solid #be8e4a;border-radius:14px;padding:3px;gap:2px;background:#a5b58a;box-shadow:inset 0 2px 0 #fff0b4,0 3px 0 #805f35,0 5px 8px #3e542d55;overflow:visible}
.tile,.tile.creature,.tile:nth-child(n){border-radius:6px;background:linear-gradient(145deg,#fff9e9,#f4e9cd);box-shadow:inset 0 1px #fffdf5,inset 0 -2px #d4c49a55;overflow:hidden}.tile.selected{background:#fff0c3!important;box-shadow:inset 0 0 0 2px #e3ae48}
.stage .tools{position:absolute;top:89%;left:11%;width:57%;height:9%;margin:0;gap:7px;z-index:6;display:grid;grid-template-columns:repeat(3,1fr)}
.stage .primary-row{position:absolute;top:89%;left:71%;width:17%;height:9%;margin:0;float:none;z-index:6;display:block}
.stage .tools button,.stage .primary-row .primary{position:relative;min-height:0;height:100%;width:100%;padding:0;border:2px solid #dba957;border-radius:17px;background:linear-gradient(135deg,#fff0c4,#e6b971);box-shadow:inset 0 2px #fff8d8,inset 0 -4px #b77736,0 3px 4px #41612b77;overflow:hidden}
.stage .tool-symbol{display:block;width:100%;height:100%}.stage .tool-symbol svg{width:82%;height:82%;margin:7% 9%}.stage #night{font-size:0;background:radial-gradient(circle at 35% 25%,#9757d3,#443b9d)}.stage #night:after{content:'☾';display:block;font-size:42px;line-height:1;color:#ffe681;text-shadow:0 2px #c78e37}
.stage .tools button:disabled,.stage #night:disabled{opacity:.48}.gate-caption{display:none}.gate-caption.boss-warning{display:block;top:81%;font-size:11px;background:#fff5dcdf;width:80%;left:10%;border:1px solid #cfaa68;border-radius:10px}.color-picker{position:relative;z-index:8;background:#f7edd3;border-radius:12px;margin-top:8px}
/* Foot-anchored, occasional gestures. No translateY/bobbing, no global reset. */
.creature:not(.drag-source) .pig-visual,.guard .pig-visual{animation:none}
.tile.creature .sprite.element,.guard .sprite.element{transform-origin:50% 86%;animation-duration:var(--idle-duration,8s);animation-delay:var(--idle-delay,-2s);animation-iteration-count:infinite;animation-timing-function:ease-in-out}
.kind-wood .sprite.element{animation-name:woodNod}.kind-water .sprite.element{animation-name:iceTilt}.kind-fire .sprite.element{animation-name:fireSniff}.kind-heart .sprite.element{animation-name:heartGreeting}
.drag-source .sprite,.drag-ghost .sprite{animation-play-state:paused!important}
@keyframes woodNod{0%,70%,89%,100%{transform:none}76%{transform:rotate(-2deg) scaleY(.96)}82%{transform:rotate(1deg) scaleY(1)}}
@keyframes iceTilt{0%,60%,85%,100%{transform:none}69%,75%{transform:rotate(3deg)}80%{transform:rotate(-1deg)}}
@keyframes fireSniff{0%,78%,95%,100%{transform:none}83%,91%{transform:scaleX(1.025) scaleY(.98)}87%{transform:none}}
@keyframes heartGreeting{0%,65%,90%,100%{transform:none}72%{transform:rotate(-3deg)}80%{transform:rotate(2deg)}86%{transform:rotate(-1deg)}}
@media(prefers-reduced-motion:reduce){.sprite.element{animation:none!important}}
:root{--controls-atlas:var(--texture-controls-atlas)}
.stage .tools button,.stage .primary-row #night{border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;filter:drop-shadow(0 3px 2px #3d552655)}
.stage .tools button:before,.stage .primary-row #night:before{content:'';display:block;position:absolute;inset:-5%;background-image:var(--controls-atlas);background-size:400% 130%;background-position:0% 50%;background-repeat:no-repeat;pointer-events:none}
.stage .tools button[data-tool="swap"]:before{background-position:33.3333% 50%}.stage .tools button[data-tool="steps"]:before{background-position:66.6667% 50%}.stage .primary-row #night:before{background-position:100% 50%}
.stage .tool-symbol,.stage #night:after{display:none}
/* Phone scene: 420 x 740. Keep combat's original world un-stretched, offset 60px. */
.stage{aspect-ratio:420/740}
.stage canvas{top:8.108108%;height:82.432432%}
.board{top:22.702703%;height:50.27027%}
.houseplate{left:8%;width:84%;top:4.5%;height:22%}
.camp-hearts{top:15.5%;left:38%;width:24%;background:#fff1d6df;border:1px solid #e6ba73;border-radius:8px;padding:2px 4px;gap:0 1px}
.camp-hearts span{font-size:clamp(13px,3.5vw,17px);line-height:1.05}
.guard{top:15.5%;height:8.1%}.guard-left{left:11%}.guard-right{right:11%}
.stage .tools,.stage .primary-row{display:none!important}
#sceneControls{position:absolute;z-index:7;left:10%;right:10%;bottom:3%;height:9%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;align-items:center}
#sceneControls button{position:relative;display:block;padding:0;width:100%;aspect-ratio:1;min-height:0;border:0;background:none;box-shadow:none;font-size:0;filter:drop-shadow(0 3px 2px #3b532d80);touch-action:manipulation}
#sceneControls button:before,#sceneControls button:after,#sceneControls .tool-symbol,#sceneControls strong,#sceneControls small{display:none!important}
.control-picture{display:block;position:absolute;inset:0;overflow:hidden;pointer-events:none}
.control-picture img{position:absolute;width:400%;max-width:none;height:133.333%;top:-16.6667%;pointer-events:none}
#sceneControls button:active{transform:translateY(2px) scale(.96)}#sceneControls button:disabled{opacity:.45}
.gate-caption.boss-warning{top:76%}
.piece-motion{display:block;position:absolute;inset:0;pointer-events:none;transform-origin:center}
.tile,.tile.creature,.tile:nth-child(n){overflow:visible}
.tile.drag-source{opacity:1}.tile.drag-source>.piece-motion{opacity:.18}
.drag-ghost.tile{background:transparent!important;border:0!important;box-shadow:none!important;filter:drop-shadow(0 5px 3px #27443266)}
.swap-preview{transform:none!important}.swap-preview>.piece-motion{transition:transform .18s ease}
.kind-heart .sprite.element{filter:hue-rotate(14deg) saturate(.85) brightness(1.1)}
.houseplate .camp-hearts{top:49%;left:34%;width:32%;height:24%;padding:0;gap:0 1px;background:none!important;border:0;border-radius:0;filter:drop-shadow(0 1px 1px #773c3577);z-index:3}
.camp-hearts span{display:block;min-width:0;min-height:0;font-size:0!important}
.camp-hearts svg{display:block;width:100%;height:100%;max-height:20px;overflow:visible}
.camp-hearts .empty{opacity:.28;filter:grayscale(.7) brightness(.65)}
.piece-motion{z-index:2}.tile:active:not(:disabled){transform:none}
/* V2 cottage artwork has ten recessed sockets in the same place at every grade. */
.houseplate{left:15%;width:70%;top:2.8%;height:22%}
.houseplate .camp-hearts{left:29.5%;top:47%;width:42%;height:18.5%;gap:0;background:none!important;border:0;padding:0;filter:none}
.camp-hearts svg{height:100%;max-height:none;filter:drop-shadow(0 1px 1px #743b3555)}
.camp-hearts .empty{opacity:0}
.guard-post{position:absolute;top:18.6%;height:3.8%;width:11%;border:2px solid #946038;border-radius:4px;background:repeating-linear-gradient(90deg,#bd8b52 0 7px,#a57443 8px 10px);box-shadow:inset 0 -3px #8c5a32,0 2px 2px #536b3d55;z-index:1}
.guard-post:before{content:'';position:absolute;left:-9%;right:-9%;top:-7px;height:10px;border:2px solid #aa7945;border-radius:50%;background:radial-gradient(ellipse,#d4ac72 30%,#ba8b50 34%,#e4c38a 40%,#d6af75 65%)}
.post-left{left:7%}.post-right{right:7%}.guard{top:11%;height:7.6%;width:14%}.guard-left{left:5.5%}.guard-right{right:5.5%}
.kind-heart .sprite.element{filter:none}
.house-fx{position:absolute;inset:0;pointer-events:none;z-index:8}.house-fx i{position:absolute;left:20%;top:55%;font-style:normal;color:#ffe284;font-size:24px;opacity:0;text-shadow:0 0 7px #fff4ae}
.house-fx i:nth-child(2){left:40%;top:35%}.house-fx i:nth-child(3){left:65%;top:45%}.house-fx i:nth-child(4){left:80%;top:65%}
.house-fx.up i{animation:houseSpark .9s ease-out}.house-fx.up i:nth-child(2n){animation-delay:.12s}
.house-fx:after{content:'';position:absolute;left:30%;top:60%;width:30%;height:25%;border-radius:50%;background:#e6dcc5;box-shadow:-22px 5px #e6dcc5cc,22px 4px #e6dcc5bb;opacity:0}.house-fx.up:after,.house-fx.down:after{animation:housePuff .7s ease-out}
@keyframes houseSpark{0%{opacity:0;transform:scale(.3)}30%{opacity:1;transform:scale(1.1)}100%{opacity:0;transform:translateY(-22px) scale(.6)}}
@keyframes housePuff{0%{opacity:0;transform:scale(.5)}30%{opacity:.7}100%{opacity:0;transform:translateY(-14px) scale(1.5)}}
.flying-reward.healing{width:28px;height:27px}.flying-reward.healing svg{width:100%;height:100%}
/* One live recessed heart panel covers the baked sockets: filled/empty share geometry. */
.houseplate{left:20%;width:60%;top:-.5%;height:25%}
.houseplate .camp-hearts{left:27.5%;top:44.5%;width:46%;height:23%;box-sizing:border-box;padding:3% 2.2%;gap:1px 2px;background:#efd0a0!important;border:1px solid #ac7848;border-radius:7px;box-shadow:inset 0 2px 3px #89562d66,0 1px 1px #ffeac2;filter:none}
.camp-hearts span{display:flex;align-items:center;justify-content:center}
.camp-hearts svg{width:100%;height:100%;filter:drop-shadow(0 1px 0 #b8835a)}
.camp-hearts .empty{opacity:1;filter:brightness(.46) saturate(.65)}
#stage #sceneControls #night{background:transparent!important;border:0;box-shadow:none;border-radius:0}
.stage .game-header{justify-content:flex-start;gap:6px}
.move-pill{margin:0;padding:2px 9px;min-width:65px}.move-pill strong{font-size:19px}
.header-pause{margin-left:auto}.game-header h2{font-size:14px;padding:4px 8px}
.houseplate{top:3.5%;height:21%;left:22%;width:56%}
.stage.night .tile,.stage.night .tile.creature{filter:none;background:linear-gradient(145deg,#fff9e9,#f4e9cd);box-shadow:inset 0 1px #fffdf5,inset 0 -2px #d4c49a55}
.stage.night .board{background:#a5b58a;border-color:#be8e4a;box-shadow:inset 0 2px #fff0b4,0 3px #805f35,0 5px 8px #3e542d55}
.stage.night .tile.ice-active{background:linear-gradient(145deg,rgba(136,220,255,var(--ice-opacity)),rgba(57,156,231,var(--ice-opacity))),#eef8ff;box-shadow:inset 0 0 10px #83d5ff,inset 0 0 0 2px #bcefff}
.stage canvas{opacity:1;filter:none}
/* Whole independent portraits avoid overlapping cut layers and moving seams. */
.independent-pig .pig-turn{overflow:hidden}
.independent-pig .sprite{background-image:var(--portrait);background-size:contain;background-position:center;background-repeat:no-repeat;animation:none}

/* Live life decorations directly on the facade: no panel or baked sockets. */
.houseplate{background-image:var(--house-image,var(--texture-house-grade-1));background-size:100% 100%;background-position:center}
.houseplate .camp-hearts{display:block;left:28%;top:39%;width:44%;height:31%;padding:0;gap:0;background:transparent!important;border:0!important;border-radius:0;box-shadow:none!important;filter:none}
.houseplate .camp-hearts span{position:absolute;width:19%;height:40%;display:block}
.houseplate .camp-hearts svg{width:100%;height:100%;filter:drop-shadow(0 1px 1px #79362c88)}
.houseplate .camp-hearts .empty{opacity:.16;filter:grayscale(1)}
.house-fx i{font-size:29px}.house-fx.up i{animation-duration:1.1s}
.houseplate .camp-hearts span:nth-child(1){left:0%;top:10%}
.houseplate .camp-hearts span:nth-child(2){left:20%;top:0%}
.houseplate .camp-hearts span:nth-child(3){left:40%;top:-3%}
.houseplate .camp-hearts span:nth-child(4){left:60%;top:0%}
.houseplate .camp-hearts span:nth-child(5){left:80%;top:10%}
.houseplate .camp-hearts span:nth-child(6){left:0%;top:60%}
.houseplate .camp-hearts span:nth-child(7){left:20%;top:45%}
.houseplate .camp-hearts span:nth-child(8){left:40%;top:40%}
.houseplate .camp-hearts span:nth-child(9){left:60%;top:45%}
.houseplate .camp-hearts span:nth-child(10){left:80%;top:60%}

.color-overlay{position:absolute;inset:0;z-index:100;display:grid;place-items:center;padding:18px;touch-action:manipulation}
.color-overlay[hidden]{display:none!important}
.color-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:0;background:#24321f88;box-shadow:none;cursor:default}
.color-card{position:relative;width:min(100%,330px);padding:22px 15px 17px;border:3px solid #d39a45;border-radius:22px;background:linear-gradient(#fff9e8,#f4e3b8);box-shadow:0 8px 22px #26301c55;text-align:center;color:#65411d}
.color-card>strong{display:block;font-size:14px;padding-right:15px}
.color-close{position:absolute;right:6px;top:5px;width:32px;height:32px;border:0;background:transparent;color:#81572e;font-size:25px;box-shadow:none}
.color-card .color-picker{position:relative;display:flex;justify-content:center;gap:10px;width:100%;margin:16px 0 0;padding:0;background:transparent;border:0;box-shadow:none}
.color-card .color-picker[hidden]{display:none!important}
.color-card .color-picker button{flex:1;max-width:78px;height:78px;border-radius:15px;background:#fff9e9;border:2px solid #c2b783;box-shadow:0 3px 0 #c1a875}
.color-card .color-picker button:focus-visible{outline:3px solid #62a9dc;outline-offset:2px}

/* Cottage-matched stone guard platforms; remove the old stump construction. */
.guard-post{top:18.3%;height:4.3%;width:13%;border:0;border-radius:0;background:var(--texture-guard-pedestal) center/100% 100% no-repeat;box-shadow:none}
.guard-post:before{content:none}.post-left{left:6%}.post-right{right:6%}
.guard{top:10.7%;height:8.5%;width:15%;z-index:5}.guard-left{left:5%}.guard-right{right:5%}

/* Fit BOTH dimensions. Keep the complete portrait scene inside browser chrome
   and device safe areas; no CSS transform, so drag distances remain CSS pixels. */
:root{--game-viewport-height:100vh}
@supports(height:100dvh){:root{--game-viewport-height:100dvh}}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;min-height:0}
.shell{max-width:none;width:100%;padding:env(safe-area-inset-top,0px) max(6px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px))}
.topbar{width:100%;max-width:440px;height:36px;margin:0 auto;min-width:0}
.layout{display:block;padding:0}
.game-column{min-width:0;max-width:440px;width:min(100%,calc((var(--game-viewport-height) - env(safe-area-inset-top,0px) - max(6px,env(safe-area-inset-bottom,0px)) - 36px) * .5675675676));margin:0 auto}
.stage{width:100%;height:auto;aspect-ratio:420/740;container-type:inline-size}
@supports(font-size:1cqw){
 .stage .game-header{gap:1.4cqw}
 .stage .game-header h2{font-size:3.34cqw;padding:.95cqw 1.9cqw;white-space:nowrap}
 .stage .move-pill{min-width:15.5cqw;font-size:4cqw;padding:.48cqw 2.14cqw;gap:1.5cqw}
 .stage .move-pill strong{font-size:4.53cqw}
 .stage .speed,.stage .header-pause{width:9.05cqw;min-width:8.1cqw;height:7.4cqw;font-size:3.57cqw;flex-shrink:0}
 .stage #sceneControls{gap:1.9cqw}
}
@media(max-width:370px){.topbar .brand{font-size:8px}.top-actions button{padding:3px;min-width:26px}.skin-picker{max-width:65px}}
.orange-pepper .pepper-art{background:var(--texture-pepper-orange) center/contain no-repeat}
/* One side-facing silhouette, mirrored toward the current horizontal target. */
.independent-pig.kind-fire .pig-turn{transition:none}
/* Fixed-width enamel HUD: the sun and moon occupy the same space. */
.stage .game-header{height:6.2%;gap:1.4cqw;align-items:center}
.stage .game-header h2,.stage .move-pill{height:8.6cqw;display:flex;align-items:center;justify-content:center;gap:1.4cqw;border:1.5px solid #fff0bd;border-radius:3cqw;background:linear-gradient(155deg,#fff6da,#ecd297);color:#65421c;text-shadow:0 1px #fff9e8;box-shadow:inset 0 1px 0 #fff,0 2px 0 #aa7536,0 3px 5px #4f351e40;font-size:3.7cqw;padding:0 1.4cqw;white-space:nowrap;font-variant-numeric:tabular-nums}
.stage .game-header h2{width:28cqw;flex:none}
.stage .game-header h2 svg{width:6cqw;height:6cqw;flex:none;filter:drop-shadow(0 1px 1px #986c3b55)}
.stage .game-header h2.night-badge{background:linear-gradient(145deg,#6486ad,#334c77);border-color:#b8d6ef;color:#fff4cc;text-shadow:0 1px #243859}
.stage .move-pill{width:21cqw;min-width:21cqw;margin:0;background:linear-gradient(155deg,#ffeac2,#efb957)}
.stage .move-pill svg{width:5.5cqw;height:5.5cqw;color:#9a601d;flex:none}.stage .move-pill strong{font-size:5.3cqw;line-height:1}
.stage .header-undo,.stage .header-pause,.stage .speed{width:9cqw;min-width:9cqw;height:8.6cqw;padding:0;flex:none;border-radius:2.7cqw;border:1.5px solid #ffe8b0;background:linear-gradient(150deg,#dca45e,#9b632d);color:#fff8df;box-shadow:inset 0 1px #ffe5b3,0 2px #704720;font-size:3.7cqw}
.stage .header-undo{margin-left:auto}.stage .header-pause{margin-left:0}.header-undo svg{width:65%;height:65%;vertical-align:middle}.header-undo:disabled{opacity:.38;box-shadow:none}.header-undo:not(:disabled):active{transform:translateY(1px)}
@media(max-width:420px){.topbar .brand{display:none}.topbar .top-actions{width:100%;justify-content:space-between}}
/* C: edge-to-edge scenery; world geometry remains uniformly scaled in CSS pixels. */
html,body{min-height:100%;background:#8faf57}
body{background-image:var(--backdrop);background-size:cover;background-position:center;background-attachment:fixed}
.shell{padding:0;width:100%;max-width:none}
.topbar{display:none!important}
.game-column{width:min(100%,calc((var(--game-viewport-height) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) * .5675675676));max-width:600px;margin:0 auto}
.stage{height:var(--game-viewport-height);aspect-ratio:auto;border-radius:0;box-shadow:none;--world-top:max(0px,calc((var(--game-viewport-height) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 176.190476cqw) * .25))}
.landscape{background-size:cover}
.stage .game-header{top:calc(env(safe-area-inset-top,0px) + 1.8cqw);height:8.6cqw;gap:1cqw;left:2.5%;right:2.5%}
.stage .game-header h2{width:26cqw;gap:1cqw;font-size:2.9cqw;padding:0 .8cqw}
.stage .game-header h2 span{display:flex;align-items:baseline;gap:.5cqw}
.stage .game-header h2 strong,.stage .move-pill strong{font-size:4.9cqw;font-weight:850;line-height:1;font-variant-numeric:tabular-nums}
.stage .game-header h2 svg{width:4.5cqw;height:4.5cqw}
.stage .move-pill{width:20cqw;min-width:20cqw;padding:0 .8cqw;gap:1cqw}
.stage .header-undo,.stage .header-pause,.stage .speed,.stage .header-settings{width:9cqw;min-width:9cqw;height:8.6cqw}
.stage .header-settings{padding:1.3cqw;flex:none;border-radius:2.7cqw;border:1.5px solid #ffe8b0;background:linear-gradient(150deg,#dca45e,#9b632d);color:#fff8df;box-shadow:inset 0 1px #ffe5b3,0 2px #704720}
.header-settings svg{width:100%;height:100%;display:block}
.stage canvas{top:calc(env(safe-area-inset-top,0px) + var(--world-top) + 14.285714cqw);height:145.238095cqw}
.stage .board{top:calc(env(safe-area-inset-top,0px) + var(--world-top) + 40cqw);height:88.571429cqw}
.houseplate{top:calc(env(safe-area-inset-top,0px) + var(--world-top) + 11cqw);height:29cqw}
.guard-post{top:calc(env(safe-area-inset-top,0px) + var(--world-top) + 32.242857cqw);height:7.57619cqw}
.guard{top:calc(env(safe-area-inset-top,0px) + var(--world-top) + 18.852381cqw);height:14.97619cqw}
.gate-caption.boss-warning{top:calc(env(safe-area-inset-top,0px) + var(--world-top) + 134cqw)}
#sceneControls{bottom:calc(env(safe-area-inset-bottom,0px) + 3cqw);height:18cqw}
.settings-overlay{position:absolute;inset:0;z-index:110;display:grid;place-items:center;padding:6cqw}
.settings-overlay[hidden]{display:none!important}
.settings-shade{position:absolute;inset:0;border:0;border-radius:0;background:#23312199;box-shadow:none;width:100%;height:100%}
.settings-card{position:relative;width:100%;max-height:85%;overflow:auto;padding:5cqw;border:2px solid #d29b4e;border-radius:5cqw;background:linear-gradient(#fff8e4,#f0dfb6);box-shadow:0 6px 22px #26301c66;color:#65421c}
.settings-card header{display:flex;align-items:center;justify-content:space-between;margin-bottom:3cqw;font-size:4.5cqw}
.settings-card header button{background:none;border:0;box-shadow:none;font-size:7cqw;color:#65421c;padding:0 2cqw}
.settings-options label{display:flex;align-items:center;justify-content:space-between;gap:2cqw;padding:2cqw 0;border-top:1px solid #d6bb8a;font-size:3.2cqw}
.settings-options button,.settings-options select{min-width:17cqw;max-width:35cqw;min-height:10cqw;padding:1.5cqw;border:1px solid #b48e55;border-radius:2cqw;background:#fff9e9;color:#65421c;font-size:3.4cqw}
.settings-card small{display:block;margin-top:3cqw;opacity:.65;text-align:center;font-size:2.6cqw}
/* D: the front door shares the same painted world and enamel controls as play. */
.herd-lobby{padding:0;background-color:#9cbd69;background-size:cover;overscroll-behavior:contain}
.herd-lobby .lobby-shell{max-width:500px;min-height:100dvh;margin:auto;padding:calc(env(safe-area-inset-top,0px) + 16px) 16px calc(env(safe-area-inset-bottom,0px) + 14px);background:linear-gradient(#ffffff08,#6a963b36)}
.lobby-heading{position:relative;text-align:center;padding:0 20px}.lobby-kicker{font-size:9px;font-weight:800;letter-spacing:2px;color:#385f41}
.herd-lobby .lobby-heading h1{font:950 clamp(24px,7vw,34px) system-ui;color:#764518;margin:3px 0 8px;letter-spacing:-1px;text-shadow:0 2px #fff5c6,0 -1px #fff5c6}
.herd-lobby .lobby-close{position:absolute;right:-5px;top:0;width:34px;height:34px;padding:0;border:2px solid #ffd89a;background:linear-gradient(#d69a50,#935622);color:#fff8da;box-shadow:0 2px #694419;border-radius:12px;font-size:25px}
.herd-yard{position:relative;height:210px;border-radius:25px;background:linear-gradient(#c4e7ee00 45%,#b5d87888);overflow:hidden}
.herd-house{position:absolute;width:76%;height:180px;left:12%;top:-14px;background:var(--texture-house-grade-2) center/contain no-repeat}
.yard-sign{position:absolute;left:22%;right:22%;top:122px;padding:5px;text-align:center;border:2px solid #f5d899;border-radius:9px;background:linear-gradient(#a06d33,#795022);color:#fff2d0;font-size:10px;font-weight:900;letter-spacing:1px;box-shadow:0 3px #60461f}
.herd-yard:after{content:'';position:absolute;bottom:1px;left:0;right:0;height:23px;background:repeating-linear-gradient(90deg,#dab779 0 10px,transparent 10px 38px);border-block:5px solid #d6ab68;border-radius:8px;box-shadow:0 3px 2px #476f3266;pointer-events:none}
#herdResidents{position:absolute;inset:0}.yard-empty{position:absolute;bottom:35px;left:5%;width:90%;text-align:center;font-size:11px;font-weight:750;color:#426b34;text-shadow:0 1px #e4f4bf}
.honor-mascot{position:relative;background:var(--texture-honor-1) center/contain no-repeat;width:94px;height:94px;margin:auto}
.honor-mascot.honor-two{background-image:var(--texture-honor-2)}
.resident.honor-mascot{position:absolute;width:116px;height:116px;left:calc(50% - 58px);bottom:15px;z-index:1;filter:drop-shadow(0 3px 2px #3f592c66)}
.player-avatar{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;background:#39aaa5;color:white;font-weight:900;font-family:system-ui;text-shadow:none;aspect-ratio:1}
.player-avatar img{width:100%;height:100%;object-fit:cover;display:block}.resident-avatar{position:absolute;left:36%;top:61%;width:28%;font-size:16px}.honor-two .resident-avatar{left:35.5%;top:57.5%;width:29%}
.resident-name{position:absolute;top:96%;left:-20%;width:140%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;font-size:10px;color:#fff9df;text-shadow:0 1px 2px #334a25;font-weight:900}
.lobby-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:9px 0}
.lobby-tabs button,.lobby-secondary{padding:10px 5px;border:1px solid #c8984e;border-radius:12px;background:linear-gradient(#fff7df,#e8cd92);color:#775125;box-shadow:inset 0 1px #fffdf0,0 2px #9d783a;font-weight:850;font-size:13px}
.lobby-tabs button[aria-selected=true]{background:linear-gradient(#e7ae53,#bd762a);color:white;text-shadow:0 1px #875223}
.lobby-pane{padding:14px;border:2px solid #d6b577;border-radius:18px;background:#fff7e5ed;box-shadow:inset 0 1px #fff,0 3px 0 #8a6e3b55;color:#694f2b}
.lobby-pane[hidden]{display:none!important}.herd-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px}.herd-summary>span{font-size:12px;white-space:nowrap;background:#ead18e;border-radius:12px;padding:4px 8px}
.honor-path{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0;text-align:center}.honor-path article{border-radius:14px;padding:4px;background:#f6e7bd}.honor-path b,.honor-path small{display:block}.honor-path b{font-size:12px;color:#774f26}.herd-lobby small{font-size:10px;color:#776648;line-height:1.5}.herd-lobby p{color:#755b35;line-height:1.5;margin:10px 0;font-size:12px}
.herd-lobby label{display:block;font-size:12px;font-weight:750;color:#735431}.herd-lobby input,.herd-lobby select{background:#fffdf4;border:1px solid #c8ad7b;color:#644a2a;font-size:14px;min-height:40px}
.avatar-editor{display:flex;align-items:center;gap:16px;margin:8px 0}.avatar-editor .player-avatar{width:58px;height:58px;border:3px solid #e9c174;font-size:26px}.avatar-upload{position:relative;background:#ecd08f;padding:10px;border-radius:12px;overflow:hidden;cursor:pointer}.avatar-upload input{position:absolute;inset:0;opacity:0;cursor:pointer}
#countryGrid{display:grid;grid-template-columns:1fr 1fr;gap:6px;max-height:230px;overflow:auto;padding:2px 2px 8px;margin-bottom:10px}.country-team,.region-team{border:1px solid #d9bd86;background:#fffaf0;border-radius:10px;padding:9px 8px;color:#70502a;text-align:left;font-size:11px;min-height:40px;box-shadow:0 2px #cfb78d55}.country-team[aria-pressed=true]{border:2px solid #ba812b;background:#fae6b1}#honorContent{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow:auto}#honorPath{font-size:12px;font-weight:850;margin:8px 0}
.lobby-bottom{padding-top:14px;text-align:center}.herd-lobby .start{border:2px solid #ffde95;border-radius:17px;padding:13px;background:linear-gradient(#f4ba57,#d88b2c);color:#fff9df;font-weight:950;font-size:21px;letter-spacing:1px;text-shadow:0 2px #a16626;box-shadow:inset 0 2px #ffe6b0,0 4px #98672b,0 6px 10px #47623255}.lobby-bottom .text-button{padding:10px;color:#fff5d9;text-shadow:0 1px #536c34;font-size:11px}.lobby-bottom>small{color:#eaf3d5}
.milestone-toast{position:absolute;z-index:80;top:25%;left:4%;width:92%;display:flex;align-items:center;gap:10px;padding:15px 24px 15px 10px;border:3px solid #efc16d;border-radius:22px;background:linear-gradient(140deg,#fffbee,#f4dea6);box-shadow:0 5px #a77a37,0 10px 25px #39452b55;color:#784a22;animation:milestonePop .35s ease-out;pointer-events:none}
.milestone-toast[hidden]{display:none!important}.milestone-toast button{position:absolute;right:4px;top:3px;width:30px;height:30px;border:0;background:none;box-shadow:none;color:#866136;font-size:23px;pointer-events:auto}.milestone-toast strong{display:block;font-size:clamp(15px,4.2cqw,22px);font-weight:950;line-height:1.12;text-shadow:0 2px white}.milestone-toast small{display:block;color:#a7732f;font-size:10px;font-weight:850;letter-spacing:1px;margin-bottom:5px}.milestone-toast p{font-size:12px;line-height:1.35;margin:6px 0 0;color:#836443}.milestone-medal{flex:none;width:64px;height:72px;display:grid;place-items:center;font-size:44px;color:#f1aa24;filter:drop-shadow(0 2px #c18b33);margin:0}
@keyframes milestonePop{from{transform:scale(.82);opacity:0}70%{transform:scale(1.025)}to{transform:scale(1);opacity:1}}
@media(prefers-reduced-motion:reduce){.milestone-toast{animation:none}}
/* Only top-tier combat pigs carry a label. It belongs to the moving piece,
   outside the turning sprite, so it never mirrors or stays on an empty cell. */
.hatch-ring.hatch-max{inset:5%;border:2px solid #ffe185;background:radial-gradient(ellipse,#fff4b266,transparent 65%);box-shadow:0 0 12px #ffd361,inset 0 0 9px #ffeab2;animation:maxHatch .8s ease-out forwards}
.hatch-max:before,.hatch-max:after{content:'✦';position:absolute;color:#fff3a0;font-size:15px;text-shadow:0 0 4px #eaa321;left:0;top:0}.hatch-max:after{left:auto;top:auto;right:0;bottom:0;font-size:11px}
@keyframes maxHatch{0%{opacity:0;transform:scale(.65)}25%{opacity:1;transform:scale(.9)}100%{opacity:0;transform:scale(1.15)}}
@media(prefers-reduced-motion:reduce){.hatch-ring.hatch-max{animation:none;opacity:.6}}

/* Foot badge follows the character, outside its mirrored facing layer. */
.piece-motion>.independent-pig{z-index:1}
.pig-visual>.level-plinth{position:absolute;left:40%;bottom:1%;right:auto;top:auto;width:20%;height:22%;z-index:4;pointer-events:none;animation:none;transform:none;box-sizing:border-box;border:1px solid var(--rim);border-radius:38%;background:linear-gradient(145deg,var(--shine) 0%,var(--top) 44%,var(--shade) 100%);box-shadow:inset 0 1px 1px #fff, inset 0 -1px 1px #0002,0 1px 1px #47351b45;filter:none}
.level-plinth:before{content:'';position:absolute;inset:2px;border:1px solid #fff7;border-radius:inherit}
.level-plinth>.plinth-level{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.plinth-level path{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.plinth-level .digit-glint{stroke:#fff8;transform:translateY(1px)}
.plinth-level .digit-ink{stroke:var(--ink)}
.plinth-1{--rim:#9c653e;--shine:#ffe5bf;--top:#e3b17b;--shade:#bd8654;--ink:#4b2816}
.plinth-2{--rim:#377f73;--shine:#d9fff1;--top:#91d2bc;--shade:#5bac96;--ink:#16483b}
.plinth-3{--rim:#4d6da5;--shine:#e0efff;--top:#a5c3ef;--shade:#7296ce;--ink:#203c6e}
.plinth-4{--rim:#a7660d;--shine:#fff8c7;--top:#f8d45b;--shade:#dca22a;--ink:#623800}
.country-flag-image{display:inline-block;width:28px;height:21px;object-fit:cover;border-radius:3px;box-shadow:0 0 0 1px #74634b30;vertical-align:middle;flex-shrink:0;margin-right:7px}.country-team{display:flex;align-items:center;gap:0}.country-choice{width:100%;display:flex;align-items:center;padding:11px!important;border:1px solid #b3b79c!important;border-radius:10px!important;background:#fffdf5!important;font-size:14px!important;text-align:left;color:#503c28}.country-choice:after{content:'⌄';margin-left:auto}.country-choice:disabled{opacity:.6}.country-dialog{box-sizing:border-box;width:min(92vw,440px);max-height:85dvh;padding:18px;border:3px solid #c49146;border-radius:22px;background:#fff5dc;color:#503c28}.country-dialog::backdrop{background:#132c37b8}.country-dialog header{display:flex;align-items:center;justify-content:space-between}.country-dialog header button{background:none;border:0;font-size:26px;color:#785633;min-width:40px;min-height:40px}.country-dialog input{width:100%;box-sizing:border-box;margin:10px 0;padding:12px;border:1px solid #cbb581;border-radius:10px;background:#fffdf5;font-size:14px}.country-picker-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;max-height:60dvh;overflow:auto}.country-picker-grid button{font-size:12px;min-height:46px;overflow-wrap:anywhere}.stage .header-undo,.stage .header-pause,.stage .speed,.stage .header-settings,.stage .header-guide{width:7.6cqw;min-width:7.6cqw;height:8.6cqw}.stage .header-guide{padding:1cqw;flex:none;border-radius:2.7cqw;border:1.5px solid #ffe8b0;background:linear-gradient(150deg,#dca45e,#9b632d);box-shadow:inset 0 1px #ffe5b3,0 2px #704720}.header-guide svg{display:block;width:100%;height:100%}.header-guide:disabled{opacity:.5}

/* Rank-coloured pedestal under the feet, with its badge on the front edge. */
.independent-pig>.rank-base{position:absolute;left:18%;bottom:1%;width:64%;height:11%;border-radius:50%;z-index:0;box-sizing:border-box;border:1px solid var(--rim);background:linear-gradient(180deg,var(--shine),var(--top) 55%,var(--shade));box-shadow:inset 0 1px #fffc,0 1px 1px #55452d44;pointer-events:none}
.independent-pig>.pig-turn{z-index:1}

/* Enlarge only the elder wood portrait; rank furniture keeps its size. */
.independent-pig.kind-wood.level-4 .character-art{transform:scale(1.10);transform-origin:50% 92%}

/* Fit the elder wood pig footplate without changing its portrait or badge. */
.independent-pig.kind-wood.level-4>.rank-base{left:23%;width:54%;height:10%;bottom:7%}

/* A compact warning below the board; only the entrance arrow marks the lane. */
.stage .gate-caption.boss-warning{font-family:'Arial Rounded MT Bold','Trebuchet MS',system-ui,sans-serif;font-size:clamp(18px,4.6cqw,28px);font-weight:950;line-height:1.15;color:#d52c21;letter-spacing:.035em;background:transparent;border:0;padding:3px 0;text-shadow:0 2px 0 #fff1ce,1px 0 #fff1ce,-1px 0 #fff1ce,0 3px 3px #6b2c2533;pointer-events:none}

/* Warning gets its own text row; the animated entrance marker stays below it. */
.stage .gate-caption.boss-warning{top:calc(env(safe-area-inset-top,0px) + var(--world-top) + 129.5cqw);left:5%;width:90%;max-height:8cqw;margin:0;padding:0;box-sizing:border-box;font-size:clamp(14px,3.8cqw,24px);line-height:1.05;white-space:normal;overflow-wrap:anywhere;text-wrap:balance;letter-spacing:.015em;animation:wolfWarningBreath 1.8s ease-in-out infinite;transform-origin:center}
@keyframes wolfWarningBreath{0%,100%{opacity:.88;transform:scale(.98)}50%{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.stage .gate-caption.boss-warning{animation:none}}
.personal-ranks h2{font-size:24px;margin:6px 0 14px;color:#674323}.rank-view-tabs{display:flex;gap:8px}.rank-view-tabs button{flex:1;border:1px solid #c99a53;border-radius:12px;padding:10px;background:#fff6de;color:#64452b;font-weight:800}.rank-view-tabs button[aria-pressed=true]{background:linear-gradient(#f7d68b,#e5af50);box-shadow:inset 0 1px #fff4c5}.rank-offline{font-size:12px;line-height:1.5;padding:10px;border-radius:12px;background:#eee8d6;color:#665a43}.rank-record{border:1px solid #d4b36e;border-radius:17px;background:linear-gradient(135deg,#fffdf1,#f9e6bc);padding:14px}.rank-player{display:flex;align-items:center;gap:9px;margin:12px 0}.rank-player .player-avatar{width:36px;height:36px}.rank-stats{display:flex;gap:12px}.rank-stats>div{flex:1;background:#fff9;padding:10px;border-radius:12px}.rank-stats small,.rank-stats strong{display:block}.rank-stats strong{font-size:26px;color:#72502b}.rank-tier-table{width:100%;border-collapse:collapse;font-size:13px}.rank-tier-table td,.rank-tier-table th{padding:9px 4px;border-bottom:1px solid #d9c9a5;text-align:left}.rank-medal{display:inline-flex;align-items:center;justify-content:center;width:28px;height:32px;margin-right:8px;border-radius:10px 10px 14px 14px;border:2px solid #fff4;box-shadow:inset 0 1px #fff9,0 2px 3px #6a4c322c;font-size:18px;vertical-align:middle}.rank-bronze{background:linear-gradient(#f2c89b,#b77b4f);color:#6e3b1b}.rank-silver{background:linear-gradient(#f5fcff,#a3bac7);color:#465f6e}.rank-gold{background:linear-gradient(#fff0a2,#e6b33d);color:#865215}.rank-diamond{background:linear-gradient(#d4f8ff,#66b7e8);color:#285487}.rank-king{background:linear-gradient(#e9b5ff,#9c53c3);color:#fff0ad}.rank-rule{font-size:12px;line-height:1.55}.personal-ranks details{font-size:12px;padding:10px 0}.lobby-tabs{flex-wrap:wrap}.lobby-tabs button{min-width:0;flex:1;font-size:13px}.herd-lobby input[aria-invalid=true]{outline:2px solid #d85645}

.herd-lobby .lobby-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.herd-lobby .lobby-tabs button{margin:0;padding:10px 4px;font-size:clamp(11px,2.9vw,13px);overflow-wrap:anywhere}

/* Fit every lobby page to the same visible viewport as gameplay. */
.herd-lobby{height:var(--game-viewport-height);overflow:hidden;padding:0}
.herd-lobby .lobby-shell{width:100%;max-width:500px;height:100%;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;padding:calc(env(safe-area-inset-top,0px) + 8px) 12px calc(env(safe-area-inset-bottom,0px) + 8px);gap:6px;overflow:hidden}
.herd-lobby .lobby-heading{flex:none}.herd-lobby .lobby-heading h1{font-size:clamp(21px,6vw,30px);margin:0}
.herd-lobby .herd-yard{flex:none;height:clamp(65px,calc(var(--game-viewport-height) * .16),140px)}
.herd-lobby .herd-house{height:90%;top:-8%;width:70%;left:15%}
.herd-lobby .yard-sign{top:auto;bottom:20%;padding:2px;font-size:9px}
.herd-lobby .yard-empty{bottom:3px;font-size:10px;z-index:1}.herd-lobby .herd-yard:after{height:12px;border-width:3px;opacity:.5}
.herd-lobby .resident.honor-mascot{height:75%;width:100px;left:calc(50% - 50px);bottom:9px}
.herd-lobby .lobby-tabs{flex:none;margin:2px 0 4px}
.herd-lobby .lobby-pane{flex:1 1 0;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px;scroll-padding:12px}
.herd-lobby .lobby-pane>*{max-width:100%;box-sizing:border-box}.herd-lobby input,.herd-lobby select{font-size:16px;min-width:0;box-sizing:border-box}
.herd-lobby .lobby-bottom{flex:none;padding-top:3px}.herd-lobby .start{margin:0;width:100%;padding:9px;font-size:19px;min-height:44px}.herd-lobby .lobby-bottom .text-button{padding:5px 8px;margin:0}.herd-lobby .lobby-bottom>small{display:block;font-size:9px}
.herd-lobby .rank-tier-table{table-layout:fixed}.herd-lobby .rank-tier-table td,.herd-lobby .rank-tier-table th{overflow-wrap:anywhere}.herd-lobby .rank-stats>div{min-width:0}.herd-lobby .rank-player b{overflow-wrap:anywhere}
@media(max-height:560px){.herd-lobby .herd-yard{display:none}.herd-lobby .lobby-kicker{display:none}.herd-lobby .lobby-heading h1{font-size:21px}.herd-lobby .lobby-tabs button{padding:7px 3px}.herd-lobby .lobby-bottom>small{display:none}}

/* Keyboard input: scroll the whole lobby instead of crushing the form. */
.editing-field .herd-lobby{overflow-y:auto;-webkit-overflow-scrolling:touch;scroll-padding:16px}
.editing-field .herd-lobby .lobby-shell{height:auto;min-height:100%;overflow:visible}
.editing-field .herd-lobby .lobby-pane{flex:none;overflow:visible;min-height:min-content}


.editing-field .herd-lobby .lobby-bottom{flex:none}
/* The world lobby shares the game's house textures, meadow and warm gold trim. */
.herd-lobby .lobby-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
.herd-lobby .lobby-heading{padding:0 70px 0 0;text-align:left;min-height:42px}
.herd-lobby .lobby-heading h1{font-size:22px}.herd-lobby .lobby-close{display:none}
.herd-lobby .world-profile-button{position:absolute;right:0;top:4px;padding:8px 10px;border:1px solid #c8984e;border-radius:12px;background:linear-gradient(#fff7df,#e8cd92);color:#775125;font-weight:800;font-size:12px}
.herd-lobby[data-page=teams] .herd-yard,.herd-lobby[data-onboarding=name] .herd-yard{display:none}
.herd-lobby[data-onboarding=name] .lobby-tabs,.herd-lobby[data-onboarding=name] .world-profile-button{display:none}
.herd-lobby[data-onboarding=name] [data-pane=profile]>:not(.name-welcome):not(label:first-of-type):not(#avatarNote){display:none}
.herd-lobby[data-onboarding=name] .lobby-bottom>div,.herd-lobby[data-onboarding=country] .lobby-bottom>div{display:none}
.herd-lobby[data-onboarding=name] .cloud-entry,.herd-lobby[data-onboarding=country] .cloud-entry{display:none}
.herd-lobby[data-onboarding=country] #lobbyStart{display:none}
.name-welcome{display:none;text-align:center}.herd-lobby[data-onboarding=name] .name-welcome{display:block}.name-welcome h2{font-size:24px;color:#815323;margin:10px 0}.name-welcome p{max-width:280px;margin:0 auto 18px}.name-welcome .honor-mascot{width:126px;height:126px}
.herd-lobby[data-onboarding=name] .lobby-pane{display:flex;flex-direction:column;justify-content:center}
.herd-lobby[data-onboarding=name] .lobby-pane[hidden]{display:none!important}
.world-map{position:relative;border:3px solid #dbb978;border-radius:20px;overflow:hidden;min-height:115px;background:#a5d7b2;box-shadow:inset 0 2px #fff7da,0 3px #9d7e3f33;margin-bottom:8px}.world-map svg{width:100%;display:block}.world-map-caption{position:absolute;bottom:5px;left:15%;right:15%;border:2px solid #ffe3a1;border-radius:12px;background:linear-gradient(#c49047,#855124);color:#fff1c8;text-align:center;padding:5px;font-weight:900;font-size:12px;letter-spacing:1px;box-shadow:0 2px #664522}
.world-pin{position:absolute;width:16%;height:40%;background:var(--texture-house-grade-2) center/contain no-repeat;filter:drop-shadow(0 2px 1px #3d6b4666)}.pin-a{left:13%;top:12%}.pin-b{left:45%;top:22%}.pin-c{left:73%;top:44%}
.herd-lobby .world-intro{font-size:17px;font-weight:900;margin:12px 0 7px;color:#745122}.world-mode{display:flex;gap:6px;margin:8px 0}.world-mode button{flex:1;padding:7px 4px;border:1px solid #c5a368;border-radius:10px;background:#f7e9c2;color:#70512f;font-size:12px}.world-mode button[aria-pressed=true]{background:#e5b75c;color:#543a1e}
.herd-lobby #countryGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:none;overflow:visible;margin-top:10px}.herd-lobby #countryGrid[hidden]{display:none}
.herd-lobby .world-herd-card{display:flex;flex-direction:column;align-items:center;gap:3px;border:2px solid #d9b779;border-radius:16px;padding:8px;background:linear-gradient(#fffaf0,#f2e4b9);box-shadow:inset 0 2px #fff,0 3px #b8955144;min-height:130px;white-space:normal;color:#674528}.herd-lobby .world-herd-card[aria-pressed=true]{border-color:#a8bd62;background:linear-gradient(#f9ffe1,#e0ecc1)}
.world-card-house{display:block;position:relative;width:100px;height:68px;background:var(--texture-house-grade-2) center/contain no-repeat}.world-card-house .country-flag{position:absolute;right:-4px;top:2px;width:27px;height:19px;box-shadow:0 2px 3px #4335}.world-herd-card strong{font-size:14px;line-height:1.2}.herd-lobby .world-herd-card small{color:#5b773f;font-size:11px}.herd-lobby .world-offline{font-size:11px;padding:10px;border-radius:10px;background:#ede6d3;color:#78694e}.world-region{padding:9px;background:#f3e6c2;border-radius:10px}
.welcome-pig{display:flex;align-items:center;gap:10px;background:linear-gradient(115deg,#f3e8bd,#fff9e8);border-radius:16px;margin-bottom:10px;padding:6px 12px;color:#724824}.welcome-pig .honor-mascot{width:70px;height:70px;margin:0}.welcome-pig.arriving{animation:herd-arrive .5s ease-out}@keyframes herd-arrive{from{transform:scale(.94)}to{transform:scale(1)}}
.herd-journey{margin-top:14px;padding:12px;background:#eaf0ce;border-radius:14px;color:#536f36}.herd-journey b{font-size:12px}.journey-track{height:9px;background:#c6cfa2;border-radius:10px;overflow:hidden;margin:10px 0 6px}.journey-track i{display:block;height:100%;border-radius:10px;background:linear-gradient(90deg,#a7ca53,#efbc4b)}.journey-stops{display:flex;justify-content:space-between;font-size:10px;font-weight:800}.herd-journey small{display:block;margin-top:8px}
@media(prefers-reduced-motion:reduce){.welcome-pig.arriving{animation:none}}
.editing-field .herd-lobby[data-onboarding=name] .lobby-pane{justify-content:flex-start}

/* H7: follow iOS visual-viewport panning; never collapse content above a focused input. */
.herd-lobby{top:var(--game-viewport-top,0px);bottom:auto;left:0;right:0;height:var(--game-viewport-height);max-height:none}
.herd-lobby[data-onboarding=name] .lobby-pane{justify-content:flex-start}
.herd-lobby[data-onboarding=name] .name-welcome .honor-mascot{width:80px;height:80px}
.herd-lobby[data-onboarding=name] .name-welcome h2{font-size:21px;margin:8px 0}
.herd-lobby[data-onboarding=name] .name-welcome p{margin-bottom:12px}
.herd-lobby #playerName{font-size:18px;line-height:1.4;min-height:48px;scroll-margin:16px}

.picture-guide{width:min(92vw,440px);max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;border:3px solid #c49146;border-radius:26px;padding:17px 20px 12px;color:#503c28;background:linear-gradient(145deg,#fffae9,#f1e3bd);box-shadow:inset 0 0 0 3px #fff4d7,0 18px 60px #142c3370;font-family:system-ui,sans-serif}
.picture-guide::backdrop{background:#132c37b8;backdrop-filter:blur(3px)}.guide-header{display:flex;align-items:center;justify-content:space-between}.guide-brand{font-size:10px;letter-spacing:1.5px;color:#8c6c39;font-weight:900}.guide-close{border:0;background:none;font-size:26px;color:#785633;padding:0 5px}.picture-guide h2{font-size:clamp(19px,5vw,25px);line-height:1.15;margin:10px 0 16px;min-height:1.2em}.guide-art{height:220px;border:2px solid #d5bc84;border-radius:17px;background:radial-gradient(ellipse at top,#fffff4,#dfe8c1);overflow:hidden;position:relative;padding:12px;box-sizing:border-box;touch-action:pan-y}.guide-copy{font-size:14px;line-height:1.65;min-height:95px;margin:14px 0 10px}.guide-dots{display:flex;justify-content:center;gap:9px}.guide-dots button{width:24px;height:28px;padding:0;border:0;background:radial-gradient(circle,#b7b89a 4px,transparent 5px)}.guide-dots button[aria-current=step]{background:radial-gradient(circle,#b17d30 5px,transparent 6px)}.picture-guide footer{display:flex!important;justify-content:space-between;gap:12px;margin:8px 0 0;padding:0}.picture-guide footer button{border:1px solid #bb934d;border-radius:12px;padding:10px 16px;font-weight:800;background:#fff7df;color:#6b4b22}.picture-guide footer .guide-next{background:linear-gradient(#f5c766,#d99a3f);color:#4e3214;flex:1}.picture-guide button:disabled{opacity:.35}.guide-skip{display:block;margin:8px auto 0;border:0;background:none;color:#806f50;padding:5px 15px}.guide-cell{position:relative;display:inline-block;width:56px;height:62px;background:#fffae9;border:1px solid #c4cfa6;border-radius:10px;flex-shrink:0;box-shadow:0 2px 3px #73815b22}.guide-cell .level-plinth{display:none}.guide-match,.guide-growth,.guide-swap,.guide-treasure{display:flex;align-items:center;justify-content:center;gap:5px;position:relative}.guide-match .guide-cell{background:#fff1b5;border-color:#d8a641}.guide-arrow{text-align:center;font-size:26px;line-height:1.2;color:#ae7d2d}.guide-growth .guide-cell{width:52px;height:68px;background:none;border:0;box-shadow:none}.guide-growth b{color:#ba934b}.guide-bonus{position:absolute;right:4px;top:-9px;z-index:5;color:#fff;background:#609753;padding:4px 9px;border-radius:14px;border:2px solid #eff8ca;font-size:16px;animation:guideBonus 2.5s ease-in-out infinite}.guide-daynight{display:flex;justify-content:space-around;align-items:center;font-size:25px}.guide-daynight b{font-size:17px}.guide-daynight i{font-style:normal;color:#b28746}.guide-swap{margin-top:12px}.guide-swap b{color:#b48339;font-size:27px}.guide-house{position:absolute;background:var(--texture-house-grade-2) center/contain no-repeat;width:140px;height:90px}.guide-moon-house .guide-house{bottom:0;left:calc(50% - 70px);opacity:.65}.guide-wolf{position:absolute;right:35px;bottom:15px;color:#a9773c;font-size:40px}.guide-roles{display:grid;grid-template-columns:1fr 1fr;gap:9px;height:100%}.guide-role{position:relative;text-align:center;border-radius:10px;background:#fdf7dd;overflow:hidden;padding-bottom:15px}.guide-role .guide-cell{width:57px;height:62px;background:none;border:0;box-shadow:none;z-index:1}.guide-role small{display:block;position:relative;z-index:2;font-size:11px;font-weight:700}.guide-field{position:absolute;inset:0;background:linear-gradient(90deg,transparent 33%,#9ac77980 33%,#9ac77980 66%,transparent 66%)}.fire .guide-field{background:linear-gradient(transparent 30%,#ffb36f80 30%,#ffb36f80 65%,transparent 65%)}.water .guide-field{inset:8px 30%;border-radius:8px;background:#7bd7faaa}.heart .guide-field{inset:7px 24%;border:3px solid #ef8bb0;border-radius:50%;background:#ffd5e440}.role-mark{position:absolute;right:5px;top:12px;font-size:23px;color:#76562d}.guide-treasure{gap:2px}.guide-treasure .guide-cell{width:18%;height:63px}.guide-heal{height:125px;position:relative}.guide-heal .guide-house{left:8px;top:5px}.guide-heal>.guide-cell{position:absolute;right:30px;bottom:3px;background:none;border:0}.guide-heal>b{position:absolute;right:42px;top:6px;color:#d95079}.guide-heal>i{position:absolute;right:48px;top:29px;color:#ce9b44;font-size:30px;animation:guideBonus 2.5s infinite}.guide-post-scene{position:relative;height:100%}.guide-post-scene>.guide-house{top:0;left:calc(50% - 85px);width:170px;height:108px}.guide-post{position:absolute;top:64px;width:48px;height:32px;border-radius:6px;background:linear-gradient(#e6cb91,#b08a53);border:2px solid #9d7540}.guide-post.left{left:2px}.guide-post.right{right:2px}.guide-post.right>.piece-motion{top:-55px;height:65px}.guide-post .level-plinth{display:none}.guide-corner{position:absolute;left:0;bottom:3px;display:flex;gap:6px}.guide-guard-arrow{position:absolute;top:80px;left:17px;font-size:38px;color:#bf8c35;z-index:4;animation:guideBonus 2.5s infinite}.guide-lock{position:absolute;right:17px;top:100px;color:#a47732}
@keyframes guideBonus{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}@media(max-width:360px),(max-height:650px){.picture-guide{padding:12px 15px}.guide-art{height:185px}.guide-copy{font-size:12px;min-height:80px}.guide-cell{width:45px;height:52px}.guide-growth .guide-cell{width:44px;height:54px}.guide-role .guide-cell{height:45px}.guide-role small{font-size:10px}.picture-guide h2{margin:7px 0 10px}}@media(prefers-reduced-motion:reduce){.picture-guide *{animation:none!important}}

.picture-guide footer button,.guide-skip{font-size:14px;min-height:40px}.guide-close{min-width:40px;min-height:40px}

.cloud-overlay[hidden],.cloud-overlay [hidden]{display:none!important}
.cloud-overlay{position:fixed;inset:0;z-index:10000;background:#203d35b8;display:grid;place-items:center;padding:12px;box-sizing:border-box}
.cloud-overlay section{width:min(100%,420px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;background:#fff5d9;border:3px solid #c89545;border-radius:22px;padding:18px;color:#394b36;box-shadow:0 12px 40px #163a3270;font:15px/1.45 system-ui,sans-serif}
.cloud-overlay header{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:20px}
.cloud-overlay input{display:block;width:100%;box-sizing:border-box;padding:12px;margin:8px 0;font:16px system-ui;border:1px solid #a7ac8a;border-radius:10px;background:#fffdf6;color:#27392d}
.cloud-overlay button,.cloud-entry{cursor:pointer;border:1px solid #bc8b40;background:linear-gradient(#ffe8ae,#efc576);border-radius:10px;padding:10px 12px;min-height:42px;color:#4b371e;font-weight:700}
.cloud-overlay button:disabled{opacity:.5;cursor:wait}.cloud-overlay header button{font-size:22px;padding:4px 12px}
.cloud-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}.cloud-overlay [data-c=note],.cloud-overlay [data-c=beta]{font-size:12px;color:#64705b}
.cloud-overlay [data-c=identity]{overflow-wrap:anywhere}.cloud-overlay [data-c=status]{font-weight:650}.cloud-overlay [data-c=confirmation]{border:2px solid #c9954b;padding:10px;border-radius:12px;margin-top:10px}
.cloud-entry{font-size:13px}.cloud-overlay [data-c=backup]{margin-top:12px;background:#f5ecd7}
