/* The headquarters reuses the sharp garden, paper and painted wood materials. */
#app:is([data-screen=hq],[data-screen=tree],[data-screen=collection]){background:#e6cc92 url('./menu-garden.webp') center/cover no-repeat}
.hq-screen,.tree-screen,.meta-collection{height:100dvh;display:flex;flex-direction:column;overflow:hidden;color:#49301f}
.meta-top{display:flex;align-items:center;gap:10px;padding:8px 14px;flex:none;background:#f9e8c9e8;border-bottom:3px solid #674b32;z-index:2}
.meta-top>button{font-size:16px;min-height:34px;padding:5px 12px}
.meta-wallet{display:flex;align-items:center;gap:14px;min-width:0;flex:1;justify-content:center}
.meta-wallet>strong{white-space:nowrap;font:24px PandaHand,system-ui}.meta-wallet small{font-size:14px}.meta-level{font:23px PandaHand,system-ui;white-space:nowrap}
.meta-xp{height:22px;width:clamp(100px,22vw,310px);position:relative;border:2px solid #65452e;background:#f9edd3;transform:rotate(-.6deg);overflow:hidden}
.meta-xp i{height:100%;display:block;background:#6ba9a0}.meta-xp span{position:absolute;inset:0;text-align:center;font:13px/18px system-ui;color:#302419;text-shadow:0 1px #fff}
.hq-body{flex:1;min-height:0;display:flex;flex-direction:column;padding:clamp(12px,3vh,34px) 5%;gap:16px}
.hq-intro{position:relative;flex:1;min-height:80px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}
.hq-intro h1,.tree-heading h1,.meta-collection>h1{font:clamp(28px,4vw,54px) PandaHand,system-ui;margin:0;color:#fff3c6;text-shadow:2px 3px #49321d,-1px -1px #49321d;rotate:-1deg}
.hq-intro p{font:22px PandaHand,system-ui;background:#fff0ce;rotate:1deg;padding:5px 20px;margin:8px 0}
.hq-army{position:absolute;right:1%;bottom:0;display:flex;align-items:flex-end;max-width:45%;height:100%;pointer-events:none}
.hq-army img{height:95%;width:25%;object-fit:contain;filter:drop-shadow(3px 5px 0 #40231644)}
.hq-stations{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:22px;flex:none}
.hq-station{background:#fff0d6;border:8px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill/9px/1px stretch;padding:14px;rotate:-.7deg;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;box-shadow:4px 6px 0 #34211544}
.hq-station:nth-child(2){rotate:1deg}.hq-station:nth-child(3){rotate:-1.1deg}.hq-station h2{font:27px PandaHand,system-ui;margin:0;color:#287e77}.hq-station p{font:17px/1.3 PandaHand,system-ui;margin:0;max-width:34ch}.hq-station button{font:22px PandaHand,system-ui;padding:9px 17px;max-width:100%}
.hq-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff0d6e8;padding:5px 12px;font:17px PandaHand,system-ui;flex:none}
.tree-heading{padding:8px 20px;flex:none}.tree-heading h1{font-size:32px}.tree-heading p{font:17px PandaHand,system-ui;background:#fff0d6e8;padding:4px 10px;display:inline-block;margin:5px 0}
.tree-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:12px;flex:1;min-height:0;padding:0 12px 12px}
.tree-map{display:flex;flex-direction:column;min-width:0;min-height:0;background:#f8e8c6;border:5px solid #6b4a31;border-radius:8px 17px 12px 6px;box-shadow:3px 4px 0 #2e1c1744;overflow:hidden}
.tree-tools{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;background:#e9d29d;padding:5px;flex:none;z-index:1}.tree-tools button{font-size:16px;min-height:25px;padding:2px 10px}
.tree-viewport{flex:1;min-height:0;overflow:hidden;position:relative;cursor:grab;touch-action:none;background:#f8ecd3 url('./tree-paper-v1.webp') center/1280px auto repeat}
.tree-viewport:active{cursor:grabbing}.tree-world{position:absolute;width:2880px;height:1140px;transform-origin:0 0;will-change:transform}
.tree-viewport,.tree-viewport *{-webkit-user-select:none;user-select:none}
.tree-viewport img{-webkit-user-drag:none}
.tree-branches{position:absolute;inset:0;pointer-events:none}.tree-branches path{fill:none;stroke:#b29169;stroke-width:5;stroke-dasharray:9 8}.tree-branches path.owned{stroke:#438b80;stroke-width:7;stroke-dasharray:none}
.tree-tier{position:absolute;left:10px;width:2850px;border-top:3px dashed #96724a;color:#80603d;font:24px PandaHand,system-ui;padding-top:7px;pointer-events:none}
.tree-node{position:absolute;translate:-50% -50%;display:flex;flex-direction:column;align-items:center;gap:2px;width:145px;height:122px;border:4px solid #8f704d;background:#fff0d1 url('./panel-paper-v4.webp') center/100% 100%;border-radius:8px 15px 9px 5px;padding:6px;color:#573c26;box-shadow:5px 6px 0 #53351f33;font:17px/1.05 PandaHand,system-ui;rotate:-1deg}
.tree-node:nth-child(even){rotate:1deg}.tree-node img{height:54px;width:65px;object-fit:contain}.tree-node b{font-size:16px}.tree-node.family{width:215px;height:135px;font-size:26px;background-color:#deb261}.tree-node.family img{height:65px}.tree-node.available{border-color:#bd8b24}.tree-node.owned{border-color:#387f74}.tree-node.locked:not(.owned){filter:saturate(.3)}.tree-node.selected{outline:6px solid #e8ad30;outline-offset:4px;z-index:1}.tree-node:focus-visible{outline:6px solid #2caaa0;z-index:2}
.tree-detail{min-height:0;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;padding:14px;gap:12px;rotate:.5deg;background:#fff1d7;border:5px solid #765335;border-radius:5px 14px 8px 10px}
.tree-detail h2{font:29px PandaHand,system-ui;margin:0;color:#297f78}.tree-detail p{font:19px/1.25 PandaHand,system-ui;margin:0}.tree-detail .footnote{font-size:15px}.tree-detail button{font-size:19px;margin-top:auto;width:100%}.node-status{font:18px PandaHand,system-ui;color:#80531f}.tree-relic-lot{display:flex;flex-wrap:wrap;gap:6px}.tree-relic-lot img{width:55px;height:55px;object-fit:contain}
.meta-collection>h1{font-size:32px;padding:8px 20px}.meta-album{flex:1;min-height:0;display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px;padding:0 18px 16px}
.meta-album>nav{overflow-y:auto;overflow-x:hidden;background:#fff0d9;padding:10px;rotate:-.4deg}.meta-album h2{font:27px PandaHand,system-ui;margin:0 0 8px;color:#297d76}.meta-album nav button{display:flex;gap:6px;align-items:center;width:100%;font-size:18px;padding:5px;margin-bottom:5px;text-align:left}.meta-album nav img{width:34px;height:34px;object-fit:contain}.meta-album nav p{font-size:14px}
.meta-relics{overflow-y:auto;overflow-x:hidden;padding:12px;background:#fff0d9e8;min-width:0}.meta-relic-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:13px}.meta-relic-grid button{display:flex;flex-direction:column;align-items:center;padding:9px;gap:5px;min-width:0;font:18px PandaHand,system-ui;background:#fff3d9}.meta-relic-grid img{width:65px;height:65px;object-fit:contain}.meta-relic-grid span{font-size:14px}.meta-relic-grid .locked{filter:grayscale(1);opacity:.65}.meta-relic-grid .unlocked{border-color:#4c8b7e}
.unlock-notice{position:fixed;z-index:40000;right:max(14px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));width:min(360px,88vw);display:flex;align-items:center;gap:13px;padding:14px 18px;background:#244e45;color:#fff3ca;border:3px solid #ddb55b;border-radius:6px 12px 8px 5px;box-shadow:0 4px 16px #0007;pointer-events:none;transform:translateY(140%);opacity:0;transition:transform .25s cubic-bezier(.2,.9,.3,1),opacity .2s;font:23px PandaHand,system-ui}
.unlock-notice.visible{transform:translateY(0) rotate(-.6deg);opacity:1}.unlock-notice>span{font-size:35px}.unlock-notice small{display:block;font:16px/1.2 PandaHand,system-ui;margin-top:5px}
.unlock-notice strong,.unlock-notice small{color:#fff3ca}
.meta-access{font-size:14px!important;padding:3px 8px!important;min-height:28px!important}
@media(max-height:550px){.meta-top{padding:4px 9px;gap:6px}.meta-top>button{font-size:13px;min-height:27px;padding:2px 9px}.meta-level{font-size:17px}.meta-wallet{gap:7px}.meta-wallet>strong{font-size:18px}.meta-wallet small{display:none}.meta-xp{height:19px}.meta-xp span{font-size:11px;line-height:15px}.hq-body{padding:8px 3%;gap:8px}.hq-intro{min-height:48px}.hq-intro h1{font-size:29px}.hq-intro p{font-size:16px;margin:3px 0}.hq-stations{gap:10px}.hq-station{padding:6px;gap:4px;border-width:5px}.hq-station h2{font-size:19px}.hq-station p{font-size:14px}.hq-station button{font-size:16px;padding:4px 10px;min-height:26px}.hq-footer{font-size:12px;padding:2px 6px}.hq-footer button{font-size:12px;min-height:23px;padding:2px 6px}.tree-heading{padding:3px 12px}.tree-heading h1{font-size:22px}.tree-heading p{font-size:13px;margin:2px 0}.tree-layout{grid-template-columns:minmax(0,1fr) 205px;gap:7px;padding:0 7px 7px}.tree-tools{gap:3px;padding:3px}.tree-tools button{font-size:12px;min-height:22px;padding:1px 6px}.tree-detail{padding:8px;gap:7px}.tree-detail h2{font-size:21px}.tree-detail p,.node-status{font-size:15px}.tree-detail button{font-size:14px;min-height:28px;padding:5px}.tree-detail .footnote{display:none}.meta-collection>h1{font-size:23px;padding:4px 12px}.meta-album{grid-template-columns:160px minmax(0,1fr);gap:7px;padding:0 8px 6px}.meta-album nav button{font-size:14px;padding:2px}.meta-album nav img{width:23px;height:23px}.meta-album h2{font-size:21px}.meta-relic-grid{grid-template-columns:repeat(auto-fill,minmax(115px,1fr));gap:7px}.meta-relic-grid img{width:40px;height:40px}.meta-relic-grid button{font-size:15px;padding:5px}.unlock-notice{width:285px;font-size:20px;padding:9px 12px}.unlock-notice small{font-size:14px}}
@media(prefers-reduced-motion:reduce){.unlock-notice{transition:opacity .15s;transform:none}.unlock-notice.visible{transform:none}}
@media(max-height:320px){.hq-body{gap:5px;padding:5px 3%}.hq-intro{flex:0 0 32px;min-height:0}.hq-intro h1{font-size:25px}.hq-intro p{display:none}.hq-army{height:42px}.hq-stations{flex:1;min-height:0}.hq-station{min-height:0;padding:4px;gap:3px}.hq-station h2{font-size:17px}.hq-station p{font-size:12px;line-height:1.1;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.hq-station button{font-size:14px;padding:3px 7px;min-height:25px}.hq-footer{font-size:11px;min-height:23px}.hq-footer button{font-size:11px}}
/* Bedroom V2: one fitted illustration and hotspots bound to its coordinates. */
.bedroom-screen{display:grid;place-items:center;background:#d8c19b;isolation:isolate}
.bedroom-scene{position:relative;width:100vw;height:100dvh;overflow:hidden}
.bedroom-object-plane{position:absolute;left:50%;top:50%;translate:-50% -50%;width:max(100vw,calc(100dvh * 1.776833));aspect-ratio:1672/941}
.bedroom-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}
.bedroom-top{position:absolute;inset:0 0 auto;background:none;border:0;padding:6px;gap:8px;pointer-events:none;box-sizing:border-box}
.bedroom-top>*{pointer-events:auto}.bedroom-title{font:clamp(12px,1.6vw,24px) PandaHand,system-ui;padding:4px 10px;background:#fff0d7e8;rotate:-1deg;white-space:nowrap}
.bedroom-top>button{font-size:clamp(10px,1.4vw,18px);padding:3px 8px;min-height:25px}
.bedroom-top .meta-wallet{background:#fff0d9e8;border:2px solid #80613c;border-radius:4px 8px 5px 3px;padding:4px 8px;flex:0 1 auto;margin-left:auto;gap:8px}
.bedroom-top .meta-level{font-size:18px}.bedroom-top .meta-xp{width:clamp(70px,12vw,180px);height:17px}.bedroom-top .meta-xp span{font-size:10px;line-height:13px}
.meta-wallet>strong{display:flex;gap:5px;align-items:center}.bamboo-icon{display:inline-block!important;width:27px!important;height:30px!important;object-fit:contain;vertical-align:middle;flex:none}
.tree-node b{display:flex;align-items:center;gap:3px}.tree-node .bamboo-icon{width:19px!important;height:21px!important}.tree-detail button .bamboo-icon{width:23px!important;height:25px!important}
.room-hotspot{position:absolute;display:block!important;padding:0!important;margin:0!important;border:0!important;border-image:none!important;background:transparent!important;box-shadow:none!important;min-width:0!important;min-height:0!important;animation:none!important;transform:none!important;filter:none!important;overflow:visible;outline:0;z-index:1;cursor:pointer}
.room-map{left:34%;top:4%;width:47%;height:51%}.room-tree{left:11%;top:34%;width:21%;height:24%}.room-album{left:78%;top:42%;width:21%;height:25%}
.object-outline{position:absolute;inset:0;border:3px solid transparent;border-radius:6px;transition:border-color .12s,box-shadow .12s;pointer-events:none}
.room-sign{position:absolute;top:100%;left:50%;translate:-50% 5px;display:flex;align-items:center;justify-content:center;white-space:nowrap;padding:8px 19px;font:clamp(13px,2vw,27px) PandaHand,system-ui;color:#493022;background:url('./sign-honey-v4.webp') center/100% 100% no-repeat;min-height:38px;box-sizing:border-box;rotate:-1deg;text-shadow:0 1px #fff7}
.room-tree .room-sign,.room-album .room-sign{font-size:clamp(12px,1.7vw,23px);padding:6px 13px;min-height:34px;background-image:url('./sign-ivory-v4.webp')}
.room-hotspot:is(:hover,:focus-visible) .object-outline{border-color:#f4cb60;box-shadow:0 0 0 2px #68492c,0 0 25px #f8d16e88}.room-hotspot:is(:hover,:focus-visible) .room-sign{filter:brightness(1.12);animation:room-label 1.8s ease-in-out infinite alternate}
@keyframes room-label{from{rotate:-1.3deg;scale:1.03}to{rotate:1.3deg;scale:1.03}}
.bedroom-footer{position:absolute;bottom:1.5%;right:1%;display:flex;gap:7px}.bedroom-footer button{font:clamp(10px,1.2vw,16px) PandaHand,system-ui;background:transparent;min-height:22px;padding:3px 9px}
@media(max-height:550px){.bedroom-footer{left:1%;right:auto}}
.collection-icon-grid>.collection-item{box-sizing:border-box;overflow:hidden;isolation:isolate}
.collection-icon-grid>.collection-item>img{position:absolute;inset:10%;width:80%!important;height:80%!important;max-width:80%;max-height:80%;min-width:0;min-height:0;object-fit:contain}
.collection-icon-grid>.collection-item>.drawn-lock{max-width:48%;max-height:60%;z-index:1}
.tree-upwards .tree-world{width:4200px;height:1420px}.tree-upwards .tree-node{width:112px;height:112px;border-width:3px;font-size:17px}.tree-upwards .tree-node img{width:50px;height:48px}.tree-upwards .tree-node.family{width:220px;height:95px;font-size:33px;justify-content:center;background-image:url('./sign-honey-v4.webp');border:0;background-color:transparent;box-shadow:none}.tree-upwards .tree-node.character{width:140px;height:112px;border:0;box-shadow:none;background:none;font-size:21px;pointer-events:auto;cursor:pointer}.tree-upwards .tree-node.character img{height:70px;width:80px}.tree-upwards .tree-node.character span{background:#fff2d9;padding:3px 6px;border-bottom:3px solid #c39a62;border-radius:3px}.tree-shared{position:absolute;translate:-50% -50%;width:150px;text-align:center;font:24px PandaHand,system-ui;background:#fff0d2;border-bottom:3px solid #bb965d;padding:10px 5px}.tree-branches path.tree-trunk{stroke:#8e6844;stroke-width:6;stroke-dasharray:none}.tree-upwards .tree-branches path{stroke-linejoin:round;stroke-linecap:round}.power-change{display:flex;flex-direction:column;margin:0;gap:10px;font:18px PandaHand,system-ui}.power-change>div{display:flex;justify-content:space-between;gap:8px;border-bottom:1px dashed #ac9065;padding-bottom:4px}.power-change dd{margin:0;white-space:nowrap}.power-change dd b{color:#27766c}
.collection-scroll{background:#f4e4c2}.collection-heading{display:flex;align-items:center;gap:12px;padding:8px 20px;flex:none}.collection-heading h1{font:32px PandaHand,system-ui;margin:0}.collection-heading>span{margin-left:auto;font:19px PandaHand,system-ui}.collection-scroll-list{flex:1;min-height:0;overflow:auto;overflow-x:hidden;padding:0 5% 30px;scrollbar-gutter:stable}.collection-family{padding:12px 0 22px}.collection-family>h2{font:30px PandaHand,system-ui;color:#276e67;margin:0 0 10px;border-bottom:3px solid #c5a36d;rotate:-.25deg}.collection-category{margin:10px 0 19px}.collection-category>h3{font:22px PandaHand,system-ui;display:flex;align-items:center;gap:8px;margin:4px 0 8px}.collection-category>h3 img{width:40px;height:40px;object-fit:contain}.collection-icon-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:clamp(6px,1.3vw,18px);max-width:1000px}.collection-item{position:relative;width:100%;aspect-ratio:1;display:grid;place-items:center;background:#fff1d5!important;border:2px solid #b08b56;padding:8px!important;min-width:0!important;min-height:0!important;border-radius:5px 8px 4px 6px;box-shadow:2px 3px 0 #72543933}.collection-item>img{width:90%;height:90%;object-fit:contain}.collection-item.undiscovered>img{filter:grayscale(1);opacity:.68}.collection-item.locked{opacity:1!important;filter:none!important;cursor:default}.collection-item.locked>img{filter:grayscale(1);opacity:.19}.drawn-lock{width:34px;height:40px;position:absolute;left:50%;top:50%;translate:-50% -50%;filter:drop-shadow(1px 2px #fff8)}.family-pending{font:18px PandaHand,system-ui;color:#886c4c}.collection-hover{position:fixed;right:18px;bottom:18px;width:min(390px,75vw);padding:12px 18px;display:flex;gap:12px;background:#fff2d8;border:3px solid #7b5836;border-radius:5px 10px 6px 4px;box-shadow:3px 5px 0 #46312144;z-index:20;pointer-events:none}.collection-hover[hidden]{display:none}.collection-hover>img{width:65px;height:65px;object-fit:contain}.collection-hover h2{font:24px PandaHand,system-ui;margin:0;color:#287970}.collection-hover p{font:17px/1.2 PandaHand,system-ui;margin:4px 0 0}
@media(max-height:550px){.bedroom-title{display:none}.bedroom-top{gap:4px;padding:3px}.bedroom-top .meta-wallet{padding:2px 5px;gap:5px}.bedroom-top .meta-level{font-size:14px}.bedroom-top .meta-xp{width:80px;height:16px}.bedroom-top .bamboo-icon{width:21px!important;height:22px!important}.room-sign{font-size:16px;min-height:28px;padding:5px 12px;translate:-50% 2px}.room-tree .room-sign,.room-album .room-sign{font-size:14px;min-height:26px;padding:4px 9px}.bedroom-footer button{font-size:10px;padding:2px 5px}.collection-heading{padding:3px 12px}.collection-heading h1{font-size:22px}.collection-heading>span{font-size:13px}.collection-scroll-list{padding-inline:4%}.collection-family{padding-top:5px}.collection-family>h2{font-size:23px}.collection-category>h3{font-size:18px;margin:3px 0}.collection-category>h3 img{width:27px;height:27px}.collection-icon-grid{gap:8px}.collection-item{padding:4px!important}.drawn-lock{width:24px;height:29px}.power-change{font-size:14px;gap:5px}.collection-hover{padding:8px 12px;width:310px}.collection-hover h2{font-size:20px}.collection-hover p{font-size:14px}}

/* Bedroom V3: larger real objects, coordinates tied to the illustration. */
.room-map{left:34%;top:8%;width:46%;height:45%}.room-tree{left:7%;top:30%;width:28%;height:28%}.room-album{left:79%;top:41%;width:20%;height:25%}
.room-map .room-sign{top:76%;left:58%}

/* Bounds measured on the approved 1672 x 941 room. */
.room-map{left:35%;top:3%;width:44%;height:49%}
.room-map .object-outline{border-radius:2% 1% 2% 1%;rotate:-.3deg}

.room-achievements{left:85%;top:74%;width:11%;height:11%}
.room-achievements .trophy-object{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(1px 3px 2px #38251855)}
.room-achievements .room-sign{font-size:clamp(12px,1.6vw,22px);padding:5px 13px;min-height:30px;top:70%;background-image:url('./sign-honey-v4.webp')}
.achievements-screen{height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:#eeddb5 url('./story-paper.svg') repeat;color:#493326}
.achievements-heading{padding:16px 24px 12px;flex:none}.achievements-heading h1{font:34px/1.1 PandaHand,system-ui}.achievements-heading p{font:18px/1.25 PandaHand,system-ui;margin-top:5px;color:#6d563b}
.achievements-list{flex:1;min-height:0;overflow:auto;padding:8px 24px 24px}
.achievement-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;max-width:1100px;margin:0 auto}
.achievement-card{display:flex;align-items:center;gap:18px;min-width:0;padding:24px;border:10px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 10px / 2px stretch;rotate:-.6deg;box-shadow:3px 5px #59412d33}
.achievement-card:nth-child(even){rotate:.6deg}.achievement-card>img{width:95px;height:110px;object-fit:contain;flex:none}
.achievement-card h2{font:28px/1.05 PandaHand,system-ui;margin:7px 0}.achievement-card p{font:18px/1.3 PandaHand,system-ui}.achievement-state{display:inline-block;padding:3px 8px;border:1px dashed #79927d;border-radius:3px;color:#286f58;font:17px PandaHand,system-ui;background:#e0ebcf}
.achievement-card.locked>img{filter:grayscale(1);opacity:.38}.achievement-card.locked .achievement-state{color:#7e705b;background:#e4dac1;border-color:#aa9c80}
@media(max-height:500px){.achievements-heading{padding:8px 15px}.achievements-heading h1{font-size:25px}.achievements-heading p{font-size:13px}.achievements-list{padding:5px 15px 15px}.achievement-cards{gap:12px}.achievement-card{padding:13px;gap:10px;border-width:6px;border-image-width:6px}.achievement-card>img{width:60px;height:76px}.achievement-card h2{font-size:21px}.achievement-card p{font-size:14px}.achievement-state{font-size:13px}}
@media(max-width:650px){.achievement-cards{grid-template-columns:minmax(0,1fr)}}
@media(max-height:300px){.room-achievements{top:58%;height:12%}.room-album .room-sign{top:0;left:50%}}

/* Full-page canvas, with a detail drawer only after selecting a node. */
.tree-screen.tree-upwards .tree-layout{position:relative;display:block;flex:1;min-height:0;gap:0;padding:0}
.tree-screen.tree-upwards .tree-map{position:relative;width:100%;height:100%;min-height:0;border:0;display:block}
.tree-screen.tree-upwards .tree-viewport{position:absolute;inset:0}
.tree-screen.tree-upwards .tree-tools{position:absolute;left:9px;top:8px;z-index:5;background:#fff0d9ed;border-radius:3px;box-shadow:1px 2px #61432c44}
.tree-screen.tree-upwards .tree-detail{position:absolute;right:12px;top:12px;bottom:12px;width:min(350px,43%);z-index:10;rotate:0;display:flex;flex-direction:column;overflow:hidden;gap:10px;padding:12px;animation:tree-detail-slide .2s cubic-bezier(.2,.7,.2,1)}
.tree-detail-heading{display:flex;align-items:flex-start;gap:8px;flex:none}.tree-detail-heading h2{flex:1;min-width:0;margin:0;font-size:26px}.tree-detail-heading button{flex:none;width:29px!important;min-height:27px!important;margin:0!important;padding:1px 6px!important}
.tree-detail-body{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:10px}
.tree-detail-actions{flex:none;display:flex;flex-direction:column;gap:7px;border-top:1px dashed #ac8f63;padding-top:9px}.tree-detail-actions button{flex:none;margin:0;width:100%}
@keyframes tree-detail-slide{from{transform:translateX(110%);opacity:0}to{transform:translateX(0);opacity:1}}
@media(max-height:500px){.tree-screen.tree-upwards .tree-detail{top:5px;right:5px;bottom:5px;width:36%;padding:8px;gap:5px}.tree-detail-heading h2{font-size:20px}.tree-detail-body{gap:6px}.tree-detail-body p,.node-status{font-size:14px}.tree-detail-actions{padding-top:5px;gap:4px}.tree-detail-actions button{min-height:29px!important;padding:3px 6px!important}.tree-screen.tree-upwards .tree-tools{left:5px;top:5px}}

.tree-tier-boundary{position:absolute;left:0;border-top:4px dashed #96734d;pointer-events:none;color:#795b3e}.tree-tier-boundary span{position:absolute;left:30px;bottom:12px;padding:8px 18px;background:#fff2d8;box-shadow:2px 3px #795b3e33;font:24px PandaHand,system-ui;border-radius:3px 9px 5px 7px}

/* Troupe: existing HQ illustration and paper palette, independent scrolling. */


.troupe-screen{height:100dvh;display:flex;flex-direction:column;background:#f8edce;color:#493526;overflow:hidden}
.troupe-screen .meta-top{position:static;flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px}
.troupe-screen h1{font-size:clamp(22px,3vw,40px);margin:0;text-align:center}
.troupe-body{flex:1;min-height:0;overflow:auto;padding:8px clamp(12px,3vw,48px) 20px;overscroll-behavior:contain}
.troupe-warning{border:2px solid #ac4932;border-radius:10px;background:#fff4da;padding:12px 18px;text-align:center}
.troupe-warning strong{font-size:clamp(18px,2.1vw,28px);color:#9c3224;display:block}
.troupe-warning p{margin:6px 0 0;font-size:clamp(15px,1.4vw,20px)}
.troupe-slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:18px auto;max-width:1100px}
.troupe-slot{min-width:0;border:2px solid #b89a6b;border-radius:10px;padding:7px;background:#fffaeb;text-align:center}
.troupe-slot.selected{outline:3px solid #358d83;outline-offset:1px}
.troupe-slot>span,.troupe-slot>small{display:block;font-size:clamp(12px,1.3vw,18px)}
.troupe-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:110px;padding:8px;gap:6px;background:#f6e7c6;border:2px solid #957247;border-radius:8px;box-shadow:none;font-size:clamp(14px,1.5vw,20px);line-height:1.15}
.troupe-choice img{height:76px;width:100%;object-fit:contain;image-rendering:auto}.troupe-choice strong{overflow-wrap:anywhere}
.troupe-choice:disabled{opacity:.45;cursor:default}.troupe-random{font-size:60px;line-height:76px;color:#32877f}
.troupe-picker h2{font-size:clamp(18px,2vw,28px);margin:18px 0 10px}.troupe-family h3{margin:16px 0 8px;font-size:24px}
.troupe-random-choice{display:flex;align-items:center;gap:20px}.troupe-random-choice .troupe-choice{max-width:180px}
.troupe-character-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.troupe-character-grid article{padding:8px;background:#fff7e3;border:1px solid #bba078;border-radius:8px;min-width:0}
.troupe-character-grid p{font-size:16px;line-height:1.3;margin:8px 0}.troupe-character-grid small{color:#9c3224}
.troupe-footer{display:flex;flex:none;align-items:center;justify-content:space-between;gap:16px;padding:10px 24px;border-top:2px solid #b89a6b;background:#f8edce}.troupe-footer p{font-size:18px;margin:0}.troupe-footer button{flex:none}
.troupe-summary{max-width:900px;margin:18px auto;text-align:center;font-size:22px}.troupe-mode-tag{font-size:16px;color:#9c3224}
.achievements-list>h2{font-size:clamp(22px,2.4vw,34px);margin:20px 10px 12px}.achievements-list>p{padding:12px;font-size:17px}
@media(max-height:550px){.troupe-screen .meta-top{padding:5px 12px}.troupe-warning{padding:8px 12px}.troupe-warning p{font-size:14px}.troupe-slots{gap:8px;margin:12px auto}.troupe-choice{min-height:70px;font-size:14px}.troupe-choice img{height:52px}.troupe-random{font-size:40px;line-height:52px}.troupe-footer{padding:6px 12px}.troupe-footer p{font-size:14px}.troupe-footer button{font-size:17px;padding:8px 16px}}
@media(max-width:600px){.troupe-slots{gap:5px}.troupe-slot{padding:4px}.troupe-slot>span{font-size:11px}.troupe-choice{padding:4px;font-size:12px}.troupe-choice img{height:48px}.troupe-footer{gap:8px}.troupe-footer p{font-size:13px}.troupe-screen .meta-top button{font-size:14px}.troupe-screen h1{font-size:20px}}

.room-mode-buttons{position:absolute;left:37%;top:34%;width:42%;z-index:6;display:grid;grid-template-columns:1fr 1fr;gap:10px;pointer-events:auto}
.room-mode-buttons button{width:100%;font-size:clamp(14px,1.75vw,26px);padding:12px 10px;line-height:1.15;min-height:64px;box-shadow:0 4px 7px #39251755}
.troupe-family-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.troupe-family-tabs button{font-size:17px;padding:8px 12px}
@media(max-height:550px){.room-mode-buttons{top:34%;gap:7px}.room-mode-buttons button{font-size:clamp(12px,1.7vw,18px);padding:8px 6px;min-height:50px}.troupe-family-tabs button{font-size:14px;padding:6px 8px}}

/* QG V7 : conserver la présentation plein écran validée. */
.bedroom-stage{position:absolute;inset:0}
.bedroom-top{z-index:3}.bedroom-footer{z-index:3}
.bedroom-screen .room-hotspot .room-sign{top:auto;bottom:0;left:50%;translate:-50% 0}
.bedroom-screen .room-achievements .room-sign{top:auto;bottom:0;background-image:url('./sign-ivory-v4.webp')}
.bedroom-screen .room-hotspot:disabled{opacity:.7;cursor:not-allowed}

.tree-progress-summary{display:flex;flex:none;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 18px;padding:5px 12px;color:#51351f;background:#f8ecd3;font:17px/1.2 PandaHand,system-ui;border-bottom:1px solid #b99a69}
.tree-progress-summary strong{color:#387e72}.tree-progress-summary span{text-align:center}
@media(max-height:550px){.tree-progress-summary{font-size:13px;padding:3px 8px;gap:3px 10px}}
.unit-family{color:#367f73}

.tree-character-card .tree-character-hero{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.tree-character-portrait{width:96px;height:108px;object-fit:contain;flex:none}
.tree-character-family{color:#367f73!important;font-size:16px!important;margin-bottom:6px!important}
.tree-character-role{font-size:17px!important}.tree-character-card h3{font:20px PandaHand,system-ui;color:#963622;margin:12px 0 6px}
.tree-character-card .tree-companion{display:flex;gap:10px;align-items:flex-start;margin-top:12px;border-top:1px dashed #ac9065;padding-top:10px}
.tree-companion img{width:58px;height:68px;object-fit:contain;flex:none}.tree-companion strong{display:block;margin-bottom:5px}
@media(max-height:550px){.tree-character-portrait{width:64px;height:72px}.tree-character-card .tree-character-hero{gap:8px;margin-bottom:8px}.tree-character-family{font-size:13px!important}.tree-character-role{font-size:14px!important}.tree-character-card h3{font-size:17px;margin:8px 0 4px}.tree-companion img{width:42px;height:50px}}
