/* Reward and building ceremonies float directly over the existing game. */
#dialog:not(.mother-modal)>.close[hidden]{display:none!important}
html:has(#dialog:not(.mother-modal)[open]:is([data-kind="chestrewards"],[data-kind="buildingcomplete"])),body:has(#dialog:not(.mother-modal)[open]:is([data-kind="chestrewards"],[data-kind="buildingcomplete"])){overflow:hidden;overscroll-behavior:none}
#dialog:not(.mother-modal):is([data-kind="chestrewards"],[data-kind="buildingcomplete"]){position:fixed;inset:0;box-sizing:border-box;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:max(58px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));border:0;border-radius:0;box-shadow:none;background:radial-gradient(ellipse at 50% 42%,#e6c87813,transparent 62%);color:#fff9df;overflow:hidden;overscroll-behavior:contain}
#dialog:not(.mother-modal):is([data-kind="chestrewards"],[data-kind="buildingcomplete"])::backdrop{background:#13231dc4;backdrop-filter:blur(2px)}
#dialog:not(.mother-modal):is([data-kind="chestrewards"],[data-kind="buildingcomplete"]) #dialogBody:not(.mother-body){display:grid;place-items:center;min-height:0;height:100%;width:100%;overflow:visible}
#dialog:not(.mother-modal):is([data-kind="chestrewards"],[data-kind="buildingcomplete"])>.close{position:absolute;top:max(9px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));z-index:20;width:44px;height:44px;background:#ffffff0d;color:#f7f1d9;font-size:30px;border-radius:50%;text-shadow:0 2px 3px #122017}
#dialog:not(.mother-modal):is([data-kind="chestrewards"],[data-kind="buildingcomplete"])>.close:hover{background:#ffffff1a}
#dialog:not(.mother-modal):is([data-kind="chestrewards"],[data-kind="buildingcomplete"])>.close:focus-visible{background:#ffffff20;color:#fff;outline:2px solid #ecd18d;outline-offset:2px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-celebration{width:100%;max-width:440px;max-height:100%;min-height:0;display:flex;flex-direction:column;margin:auto;overflow:visible}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-celebration header{flex:none;padding:0 12px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-eyebrow{color:#c9d2b3;font-size:12px;letter-spacing:2px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] h2{color:#fff1b3;text-shadow:0 3px 0 #403b25,0 0 26px #e3bb5d50;font-size:clamp(29px,7.8vw,38px);margin:8px 0 3px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] h3{color:#fff8dc;font-size:22px;margin:14px 0 18px;text-shadow:0 2px 4px #17251d}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stage{flex:0 0 clamp(190px,29dvh,260px);margin-top:10px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stage:before{inset:-55px -40px -25px;background:radial-gradient(ellipse,#fff1a430 5%,#efd17c21 36%,transparent 68%);pointer-events:none}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-rays{height:430px;width:430px;max-width:none;max-height:none;top:50%;left:50%;margin:-215px 0 0 -215px;background:repeating-conic-gradient(from 0deg,#f6d78940 0 8deg,transparent 8deg 30deg);mask-image:radial-gradient(circle,#000 8%,#000a 28%,transparent 66%)}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-building-art{height:clamp(160px,25dvh,218px);width:clamp(190px,65vw,250px);filter:drop-shadow(0 9px 4px #081b1b55) drop-shadow(0 0 18px #f9d7732b)}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-level{bottom:-2px;padding:7px 19px;box-shadow:0 4px 0 #5c4b27,0 0 22px #e5c47736}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-level b{font-size:26px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-level small{color:#8d7b4d;font-size:16px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stats{flex:none;gap:12px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat{background:linear-gradient(100deg,#d7e6bc0a,#e3eccb13,#d7e6bc0a);border:0;border-radius:12px;padding:13px 7px 11px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat>span{color:#d4ddc1;font-size:14px;margin-bottom:7px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat small{color:#b6c1aa;font-size:16px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat i{color:#b8c2a8}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat strong{color:#fff5cf;font-size:25px;text-shadow:0 2px 2px #173323}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat>em{color:#d5ec9f;font-size:16px;margin-top:7px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-unlocks{background:transparent;margin-top:12px;padding:0;flex:none}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-unlocks>span{color:#d5d8bc;font-size:13px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-unlocks img{height:50px;width:50px;filter:drop-shadow(0 0 7px #f8e3a02e)}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-celebration footer{flex:none;margin-top:26px;padding-bottom:5px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-celebration footer button{min-height:52px;font-size:18px;border:1px solid #c5d79555;box-shadow:0 5px 0 #263d22,0 8px 20px #0002}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-particles i{animation-name:pf-fullscreen-spark;background:#f3d789;box-shadow:0 0 8px #ecc77566}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-batch-list{overflow:auto;min-height:0;overscroll-behavior:contain;padding:0 3px 6px;margin:22px 0 0;scrollbar-width:thin}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-batch-list article{background:#e7ebc90b;border:0;padding:8px 13px;gap:18px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-batch-list img{height:82px;width:88px;filter:drop-shadow(0 3px 10px #ffe5a322)}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-batch-list h3{margin:0 0 4px;font-size:18px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-batch-list strong{color:#f9dc88;font-size:23px}
#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-batch-list span{color:#cbd7b9;font-size:13px}
@keyframes pf-fullscreen-spark{0%{opacity:0;transform:rotate(var(--a)) translateY(-16px) rotate(0deg) scale(.5)}20%{opacity:1}100%{opacity:0;transform:rotate(var(--a)) translateY(-185px) rotate(130deg) scale(.7)}}
@media(max-height:660px){
 #dialog:not(.mother-modal):is([data-kind="chestrewards"],[data-kind="buildingcomplete"]){padding-top:max(48px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom))}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stage{flex-basis:150px;margin-top:4px}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-building-art{height:137px;width:165px}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] h2{font-size:28px}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] h3{font-size:19px;margin:10px 0 11px}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat{padding:8px 5px}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-stat strong{font-size:21px}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-celebration footer{margin-top:16px}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-unlocks{margin-top:7px}
}
@media(max-height:500px){
 #dialog:not(.mother-modal)[data-kind="chestrewards"] .reward-showcase:not([data-reward-count="1"]) .rp-card:not(.is-featured) .rp-portrait{height:72px;width:72px;max-width:100%;align-self:center;aspect-ratio:auto}
 #dialog:not(.mother-modal)[data-kind="chestrewards"] .reward-showcase:not([data-reward-count="1"]) .rp-card-copy{padding-top:4px;gap:2px}
 #dialog:not(.mother-modal)[data-kind="chestrewards"] .reward-showcase:not([data-reward-count="1"]) .rp-card-copy>strong{font-size:12px}
 #dialog:not(.mother-modal)[data-kind="chestrewards"] .rp-card-copy>strong .rp-quantity{font-size:1em}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] #dialogBody:not(.mother-body){overflow-y:auto;overscroll-behavior:contain;display:block}
 #dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-celebration{max-height:none;min-height:100%;padding:0 0 12px}
}
@media(prefers-reduced-motion:reduce){#dialog:not(.mother-modal)[data-kind="buildingcomplete"] .pf-particles{display:none}}
