/* One visual dismiss control, retaining each dialog's original close/cancel logic. */
body dialog.unified-modal{position:fixed}
body dialog.unified-modal .modal-close{position:absolute;inset:10px 10px auto auto;display:grid!important;place-items:center!important;flex:none;box-sizing:border-box;width:35.2px!important;min-width:35.2px!important;max-width:35.2px!important;height:35.2px!important;min-height:35.2px!important;max-height:35.2px!important;margin:0!important;padding:0!important;border:2px solid #fff0bc!important;border-radius:11.2px!important;background:linear-gradient(150deg,#ffe8af,#ebc777)!important;color:#354f46!important;box-shadow:0 3px 0 #8c704d!important;font-size:0!important;line-height:1!important;text-indent:-9999px;overflow:hidden;z-index:10;touch-action:manipulation;cursor:pointer;transform:none!important;rotate:none!important}
body dialog.unified-modal .modal-close>*{display:none!important}
body dialog.unified-modal .modal-close::before{content:'';position:absolute;left:50%;top:50%;right:auto;bottom:auto;width:16px;height:16px;transform:translate(-50%,-50%);background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='%23354f46' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;text-indent:0}
body dialog.unified-modal .modal-close::after{content:none!important}
body dialog.unified-modal .modal-close:active{translate:0 2px;box-shadow:0 1px 0 #8c704d!important}
body dialog.unified-modal .modal-close:focus-visible{outline:3px solid #97f1df;outline-offset:3px}
body dialog.unified-modal>.collection-heading,body dialog.unified-modal>.catalog-heading{min-height:66px;padding-right:66px;box-sizing:border-box}
body dialog.unified-modal:not(:has(>.collection-heading,>.catalog-heading)){padding-top:64px}
body dialog.unified-modal #loot-title{padding-inline:20px}
html:has(.mobile-sheet[open]){overflow:hidden;scrollbar-gutter:stable}
.mobile-sheet{inset:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));margin:auto;width:min(660px,calc(100vw - 20px));max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:0;border:2px solid #edce8c;border-radius:22px;background:#24473d;color:#fff0ca;overflow:hidden;box-shadow:0 16px 60px #081d2699}
.mobile-sheet[open]{display:flex;flex-direction:column}.mobile-sheet::backdrop{background:#081f2bd9}
.mobile-sheet .collection-heading h2{font-size:18px}
.mobile-sheet-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:16px;scroll-padding:16px}
#worry-dialog{width:min(500px,calc(100vw - 20px))}
#worry-dialog #worry-input{display:block;width:100%;box-sizing:border-box;font-size:16px!important;line-height:1.6;padding:13px;border:2px solid #b6d1af;border-radius:14px;background:#163c34;color:#fff5d6;user-select:text;touch-action:manipulation}
#worry-dialog #worry-privacy{font-size:13px;line-height:1.7;white-space:normal}
.worry-dialog-actions{display:flex;justify-content:space-between;gap:12px;margin-top:20px}.worry-dialog-actions button{min-height:44px;font:600 16px/1.4 var(--display)}
.write-worry-button{display:flex;align-items:center;justify-content:center;min-height:46px;width:100%;padding:10px 14px;border:1px solid #bbd1ad;border-radius:14px;background:linear-gradient(140deg,#3e6452,#2d5143);color:#fff1cd;box-shadow:inset 0 1px 0 #ffffff24,0 3px 0 #173d33;font:600 13.6px/1.5 var(--display);touch-action:manipulation;cursor:pointer}
.stall-showcase-open{display:flex;align-items:center;gap:12px;width:100%;min-height:78px;padding:14px;border:2px solid #e9cd85;border-radius:19px;background:linear-gradient(120deg,#436650,#2b5044);box-shadow:0 4px 0 #163b31;color:#fff2c8;font:600 18px/1.5 var(--display);text-align:left;touch-action:manipulation;cursor:pointer}
.stall-showcase-open>span:nth-child(2){flex:1}.stall-open-art{flex:0 0 44px;width:44px;height:48px}.stall-open-art svg{width:100%;height:100%}
#stall-showcase-dialog>.collection-heading{justify-content:flex-start}
#stall-showcase-dialog .stall-showcase{margin:0;max-height:none!important;overflow:visible!important;border:0;box-shadow:none}
#stall-showcase-dialog .stall-showcase-heading{display:none}
#stall-showcase-dialog-title{font:600 20px/1.5 var(--display);margin:0 0 15px}
#stall-showcase-dialog .stall-modal-tools{min-width:0}
body .decorate-stall-button,body #tab-stall.collection-launch{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;gap:8px;min-height:44px;padding:8px 12px;border:2px solid #dce5b6;border-radius:13px;background:linear-gradient(140deg,#476b52,#2d5344);color:#fff0bf;box-shadow:0 3px 0 #163b31;font:600 15px/1.4 var(--display);text-align:left;touch-action:manipulation;cursor:pointer}
.stall-button-art,#tab-stall .collection-launch-art{display:block;width:30px;height:32px;flex:0 0 30px}.stall-button-art svg{width:100%;height:100%}#tab-stall .collection-launch-arrow{display:none}
/* Smaller, left-aligned purchase actions sit under the helper's description. */
#collection-dialog-shop-kits #weapon-list>.kit-row>.kit-shop-actions{grid-column:2;justify-items:start;justify-self:start;width:100%;display:flex;flex-wrap:wrap}
#collection-dialog-shop-kits #weapon-list>.kit-row>.kit-shop-actions button{width:auto;min-width:0;max-width:100%;padding-inline:14px;text-align:left;white-space:normal;justify-content:flex-start}
#collection-dialog-shop-kits #weapon-list>.kit-row>.kit-art{scale:1.45475;transform-origin:top center}
#phase-beat .beat-telemetry{align-items:center!important}#phase-beat .ultimate-hud{align-self:center;align-items:center;height:45px}#phase-beat .ultimate-meter{align-self:center}
#sound.icon-button{display:grid;place-items:center;padding:3px!important}#sound>svg{width:100%;height:100%;overflow:visible}
@media(max-width:360px){.mobile-sheet-scroll{padding:12px}.stall-showcase-open{font-size:16px;padding:11px}#collection-dialog-shop-kits #weapon-list>.kit-row{column-gap:12px}}

#weapon-list .owned-kit-tag{display:inline-flex;width:fit-content;max-width:100%;align-self:flex-start;justify-self:start;flex:0 0 auto;white-space:normal;overflow-wrap:anywhere}
.write-worry-button:hover{border-color:#f2d598;background:linear-gradient(140deg,#4b715c,#355b49)}
.write-worry-button:focus-visible{outline:3px solid #a6e4cc;outline-offset:3px}

/* Flat inspection controls, preserving the full 44px touch target. */
body button.skin-inspect,body button.skin-inspect:active,body button.skin-inspect:disabled{box-shadow:none!important;filter:none!important;translate:none!important;transform:none!important}
body .skin-inspect svg,body .skin-inspect:active svg{box-shadow:none!important;filter:none!important;translate:none!important;transform:none!important}
#kit-catalog-dialog .preparation-kit-choice[aria-pressed=true],#kit-catalog-dialog .preparation-kit-card:has(>.preparation-kit-choice[aria-pressed=true]){border-bottom-left-radius:0;border-bottom-right-radius:0}
#kit-catalog-dialog .preparation-kit-choice>svg{width:72.45px;height:72.45px}
#collection-dialog-shop-kits #weapon-list>.kit-row{column-gap:18px}
#save-tools-title.collection-launch{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;padding:10px 12px;border:2px solid #b9c5a1;border-radius:14px;background:linear-gradient(140deg,#385c4c,#25483f);color:#fff0c9;text-align:left;font:600 16px/1.5 var(--display);touch-action:manipulation;cursor:pointer}
#collection-dialog-backup .save-actions{display:flex;flex-wrap:wrap;gap:12px;margin:18px 0}
#collection-dialog-backup .save-actions button{flex:1;min-width:130px;min-height:44px}
#collection-dialog-backup #save-tools-note,#collection-dialog-backup #save-tools-status{font-size:15px;line-height:1.8;overflow-wrap:anywhere}
#collection-dialog-shop-kits #weapon-list>.kit-row{min-height:96px}
/* Compact, stable controls in the ritual preparation and collection dialogs. */
body details,body details[open]{box-shadow:none!important}
body dialog[data-motion],body dialog[data-motion]::backdrop{animation:none!important;transition:none!important}
body .skin-inspect svg{width:21px;height:21px;box-sizing:border-box;border-radius:7px}
.preparation-kit-card,#weapon-list .kit-row{position:relative}
.preparation-kit-choice,.preparation-kit-choice[aria-pressed=true]{box-sizing:border-box;border-width:2px!important;translate:none!important;transform:none!important;padding-top:30px}
.preparation-kit-choice .kit-choice-status{display:flex;align-items:center;justify-content:center;min-height:3em;font-size:12px;line-height:1.5;font-style:normal;color:#fff0c8}
.preparation-kit-card .skin-inspect,#weapon-list .skin-inspect{position:absolute;inset:0 0 auto auto;width:44px;height:44px;min-width:44px;min-height:44px}
#weapon-list .kit-row{padding-right:40px}
#weapon-detail-art{display:grid;place-items:center;height:190px}#weapon-detail-art>svg{width:160px;height:184px}.item-detail-note{font-size:13px!important;color:#e2e9c9}
#weapon-detail-dialog .skin-detail-scroll dd{max-width:58%;text-align:right;overflow-wrap:anywhere}
#tab-kits[hidden]{display:none!important}.preparation-ready #stall-dashboard .stall-tabs.collection-launchers{grid-template-columns:1fr}
.stall-wallet>#open-stall-showcase{min-height:50px;margin:0 0 15px;padding:8px 10px;gap:8px;font-size:14px;line-height:1.5;border-radius:12px;box-shadow:0 3px 0 #163b31}
.stall-wallet>#open-stall-showcase .stall-open-art{width:28px;height:28px;flex:0 0 28px}
#save-tools-title.collection-launch{font-size:12.8px}
#story>summary,#rules>summary{font-size:17.85px!important;line-height:1.45;min-height:38px;padding-block:6px}
#purchase-coupons{margin:12px 0;padding:12px;border:1px solid #c4d2a4;border-radius:12px;background:#1c3e36;color:#fff0c8;text-align:left}
#purchase-coupon-label{display:block;font-size:15px;line-height:1.6;font-weight:600;margin-bottom:7px}
#purchase-coupon{box-sizing:border-box;width:100%;min-height:44px;border:2px solid #d9cd97;border-radius:9px;background:#15372f;color:#fff0c8;padding:8px 30px 8px 10px;font:400 16px/1.5 var(--display)}
#purchase-coupon-note{font-size:13px;line-height:1.7;margin:8px 0 0;color:#dfebce}

#story,#rules{padding-block:12px}#story>summary::after,#rules>summary::after{width:26px;height:26px;flex-basis:26px}
@media(max-width:640px){#story>summary,#rules>summary{font-size:17px!important}}
/* Keep X fixed in the modal frame while the long purchase review scrolls below it. */
body dialog.unified-modal.purchase-dialog{display:none;overflow:hidden;padding:0!important;max-height:calc(100dvh - 28px)}
body dialog.unified-modal.purchase-dialog[open]{display:flex;flex-direction:column}
.purchase-dialog .purchase-content{box-sizing:border-box;width:100%;min-height:0;max-height:calc(100dvh - 32px);padding-top:58px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
#purchase-dialog #purchase-coupons,#purchase-dialog #purchase-spent{grid-column:2}
@media(max-width:640px){#purchase-dialog #purchase-coupons,#purchase-dialog #purchase-spent{grid-column:auto}}
/* Content-width start-page actions; the original touch targets remain intact. */
.preparation-ready #write-worry,.stall-wallet>#open-stall-showcase{display:inline-flex;width:fit-content;max-width:100%;align-self:flex-start;justify-self:start;justify-content:flex-start;margin-inline:0}
.stall-wallet>#open-stall-showcase>span:nth-child(2){flex:0 1 auto}
body .skin-inspect svg,body .skin-inspect:active svg{translate:3px -3px!important;transform:none!important}
/* Five live launchers share the same grid on phones and larger screens. */
.preparation-ready #collection-menu{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0 16px;padding:0;border:0;background:none;box-shadow:none}
.preparation-ready #collection-menu>.collection-launch{width:100%;min-width:0;min-height:66px;margin:0;padding:10px;grid-column:auto;font-size:16.2px}
@media(max-width:600px){.preparation-ready #collection-menu{gap:9px}.preparation-ready #collection-menu>.collection-launch{gap:6px;padding:8px;font-size:15.12px}.preparation-ready #collection-menu .collection-launch-art{width:24px;height:30px;flex-basis:24px}.preparation-ready #collection-menu .collection-launch-arrow{width:16px;height:16px;flex-basis:16px}}

/* Reserve the same scrollbar space before, during and after every dialog. */
html{scrollbar-gutter:stable}
#save-tools-title.collection-launch{width:fit-content;max-width:100%;justify-self:start;align-self:flex-start}

/* Animate the native backdrop with CSS; WAAPI ::backdrop effects are not universal. */
body dialog[data-motion=opening],body dialog[data-motion=closing]{will-change:opacity}
body dialog[data-motion=opening]::backdrop{animation:modal-shade-in 180ms ease-out both!important}
body dialog[data-motion=closing]::backdrop{animation:modal-shade-out 150ms ease-out both!important}
@keyframes modal-shade-in{from{opacity:var(--modal-shade-start,0)}to{opacity:1}}
@keyframes modal-shade-out{from{opacity:var(--modal-shade-start,1)}to{opacity:0}}
@media(prefers-reduced-motion:reduce){body dialog[data-motion]::backdrop{animation:none!important}}

#collection-menu .collection-launch-label{font-size:inherit!important}

#save-tools-title[hidden]{display:none!important}
.save-tools:has(>#save-tools-title[hidden]){margin:0;padding:0;border:0}

@media(max-width:360px){.wallet-totals{grid-template-columns:minmax(0,1fr);gap:8px}.wallet-totals>span{display:flex;align-items:center;justify-content:space-between;gap:10px}.wallet-totals b{white-space:nowrap}}

#collection-dialog-shop-kits .weapon-inspect,#collection-dialog-shop-kits .weapon-inspect svg{background:transparent!important;border:0!important}
#collection-dialog-shop-kits .weapon-inspect svg{border:0;padding:0}
#about-game{padding-block:6px}
#about-game>summary{min-height:36px;padding-block:4px}

/* Decorative greetings end rather than animating a page left open indefinitely. */
#intro h1,#intro h1::after,#intro .slipper-grin,#intro .slipper-sweat,
.fong-logo,.fong-mage-hat,.fong-mage-robe,.player-level-badge,.player-level-badge::after,.badge-spark,
.master-equipped-title,.master-equipped-title::after,.work-shoe,.work-bang,.work-stamp,
.preparation-ready #start:not(:disabled) .work-shoe{animation-iteration-count:2!important}
/* The four border flames retain their motion; individual tongues need no extra timelines. */
.rain{animation:none!important}
body.is-playing::before,.pause-overlay,.quick-dock,body dialog::backdrop{backdrop-filter:none!important}
/* No continuous filter/box-shadow animation across the full burst scene. */
#finisher-stage::before{animation:none!important;box-shadow:none!important}
#finisher-stage .burst-storm,#finisher-stage .burst-bolt{filter:none!important}
#finisher-stage .burst-storm{animation:none!important}
#finisher-stage .burst-speedlines{animation:none;opacity:.5}
#finisher-stage .burst-branch-two{display:none}
#finisher-stage .signature-motif>svg{animation:none!important}
.ritual-stage[inert],.ritual-stage[inert] *,.ritual-stage[inert]::before,.ritual-stage[inert]::after,
.ritual-stage[inert] *::before,.ritual-stage[inert] *::after{animation-play-state:paused!important}

/* Hidden faces and thumbnail copies must not animate invisible tears. */
.paper-cry-face .paper-teardrop{animation-name:none!important}
#paper-doll.is-crying .paper-teardrop{animation-name:paper-tear-fall!important;animation-duration:.6s;animation-timing-function:ease-in;animation-iteration-count:infinite}
.skin-selection-glint rect{animation-iteration-count:2!important;will-change:auto}
/* Pseudo-elements need their own visibility/pause rules. */
[data-motion-visible=false]:not(:has(dialog[open])) *::before,
[data-motion-visible=false]:not(:has(dialog[open])) *::after,
body.is-playing :is(#intro,#welcome,#my-stall,#neighbourhood-hub,.records-card) *::before,
body.is-playing :is(#intro,#welcome,#my-stall,#neighbourhood-hub,.records-card) *::after{animation-play-state:paused!important}

@media(prefers-reduced-motion:reduce){#paper-doll.is-crying .paper-teardrop{animation-name:none!important}}

/* The live hit reaction and border aura already supply burst feedback. */
#paper-doll[data-finisher-pose]>svg,.burst-fire .burst-flame-core{animation:none!important}
.burst-fire .burst-ember:nth-child(n+2){display:none}
#phase-beat #finisher-launch[data-ready=true],#finisher-launch[data-ready=true]::before,#finisher-launch[data-ready=true]::after{animation:none!important}

/* Quiet, static preparation chrome; selected items keep their high-contrast border. */
.preparation-ready #neighbourhood-hub{margin-top:0}
.bbl-intro,.bbl-intro *,.bbl-intro::before,.bbl-intro::after,.bbl-intro *::before,.bbl-intro *::after,
.intro-slipper,.intro-slipper *,.master-equipped-title,.master-equipped-title::before,.master-equipped-title::after{animation:none!important;transition:none!important}
.bbl-intro h1::after,.master-equipped-title::after,.skin-selection-glint{display:none!important}
.skin-selection-glint rect{animation:none!important;will-change:auto}
#play-panel[data-phase=beat] .bridge-scene #stall-amethyst{display:none!important}

#collection-dialog-shop-kits .weapon-inspect{top:5px}
#collection-dialog-shop-kits .weapon-inspect::before,#collection-dialog-shop-kits .weapon-inspect::after{content:none!important}
#ritual-preparation #worry-select{margin-top:-7px}
