/* HOME release notes use the existing notes as their single content source. */
.release-notes{display:none!important}
.home-dialog{position:fixed;top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:min(480px,calc(100vw - 28px));height:auto;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);margin:0;padding:0;border:2px solid #8294ad;border-radius:16px;background:#f5f7fa;color:#273546;box-shadow:0 16px 48px #17213040;overflow:hidden;word-break:normal;overflow-wrap:break-word;-webkit-user-select:none;user-select:none}
.home-dialog::backdrop{background:#17213080}
.home-dialog-panel{padding:18px;min-width:0}
.home-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.home-dialog h2{margin:0;font-size:20px;line-height:1.35;word-break:keep-all;overflow-wrap:anywhere}
.home-dialog .ranking-close{flex:none;border:1px solid #7d8791;color:#273546}
.home-dialog-scroll{max-height:calc(100vh - 142px);max-height:calc(100dvh - 142px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.release-dialog .release-list{margin:0;gap:10px;padding-bottom:4px}
.release-dialog article{padding:0;border:0;background:transparent;font-size:12px;line-height:1.75;word-break:normal;overflow-wrap:break-word;-webkit-user-select:text;user-select:text}
.release-entry{border:1px solid #b7c5d5;border-radius:10px;background:#fff;box-shadow:var(--button-shadow);overflow:hidden;transition:transform 100ms ease-out,box-shadow 100ms ease-out}
.release-entry>summary{display:grid;grid-template-columns:max-content minmax(0,1fr) 24px;align-items:center;gap:5px 9px;min-height:68px;padding:12px 14px;list-style:none;color:#34465c;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none;transition:background 100ms ease-out}
.release-entry>summary::-webkit-details-marker{display:none}
.release-entry>summary:hover{background:#eef3f9}
.release-entry:has(>summary:active){transform:translateY(var(--button-depth));box-shadow:none}
.release-entry>summary:focus-visible{outline:2px solid #2869dc;outline-offset:-4px}
.release-dialog:not([data-keyboard-focus=true]) .release-entry>summary:focus-visible{outline:none}
.release-entry>summary strong{grid-column:1;grid-row:1;justify-self:start;padding:1px 7px;border-radius:99px;background:#34465c;color:#fff;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap}
.release-entry>summary time{grid-column:2;grid-row:1;min-width:0;color:#657587;font-size:11px;font-variant-numeric:tabular-nums}
.release-entry>summary>span{grid-column:1/3;grid-row:2;min-width:0;font-size:13px;font-weight:700;line-height:1.5;overflow-wrap:anywhere}
.release-chevron{grid-column:3;grid-row:1/3;width:20px;height:20px;fill:none;stroke:#2869dc;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform 200ms ease-out}
.release-entry[open] .release-chevron{transform:rotate(180deg)}
.release-entry[open]>summary{background:#eef4fc;border-bottom:1px solid #d5dce3}
.release-body{padding:2px 14px 14px}
.release-dialog ul{margin:9px 0 0;padding-left:1.35em}.release-dialog li+li{margin-top:4px}
@media(prefers-reduced-motion:reduce){.release-entry,.release-entry>summary,.release-chevron{transition:none}}
.app-update-dialog{width:min(360px,calc(100vw - 28px));text-align:center;border-color:#4a78bd}
.app-update-dialog p{font-size:13px;line-height:1.7;margin:16px 0;word-break:keep-all;overflow-wrap:normal;text-wrap:balance}
.home-dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}
.home-dialog-actions button{min-width:0;font-size:13px;white-space:normal;word-break:keep-all}
.encyclopedia-entry .app-update-button[data-update-available=true]{position:relative;border-color:#4175c3;background:#e6f0ff;color:#2560b6}
.encyclopedia-entry .app-update-button[data-update-available=true]::after{content:'';position:absolute;top:0;right:0;width:8px;height:8px;border:1.5px solid #fff;border-radius:50%;background:#e84646}
.encyclopedia-entry{gap:clamp(7px,2vw,14px)}
@media(max-width:420px){:is(.encyclopedia-entry,.settings-toggles) :is(#encyclopedia-open,.language-button,.sound-button){width:40px;height:40px;min-height:40px}.home-dialog-panel{padding:15px}.home-dialog h2{font-size:18px}}

.app-update-dialog:is([data-state=current],[data-state=checking]) .home-dialog-actions{grid-template-columns:1fr}

/* Keep the collection and HOME tools centered in one row where space allows. */
.guide{display:none!important}
.encyclopedia-entry{--home-icon-size:48px;--home-icon-gap:14px;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px var(--home-icon-gap);width:100%;max-width:calc(5 * var(--home-icon-size) + 4 * var(--home-icon-gap));margin:16px auto 4px}
.encyclopedia-entry :is(#encyclopedia-open,.sound-button){flex:none}
/* Still images are captured with the actual EncyclopediaPreview renderer. */
.help-dialog{width:min(440px,calc(100vw - 28px));background:#fff}
.help-dialog .home-dialog-header{margin-bottom:0;padding-bottom:16px;border-bottom:1px solid #dce3eb}
.help-sections{display:grid;gap:0}
.help-feature{display:grid;grid-template-columns:82px minmax(0,1fr);align-items:center;gap:18px;padding:20px 0;border-bottom:1px solid #e5eaf0}
.help-top-image{display:block;width:100%;height:auto;border-radius:10px}
.help-top-pair{display:grid;align-content:center;gap:2px}
.help-top-pair img{display:block;width:100%;height:auto;border-radius:8px}
.help-feature-copy{min-width:0}
.help-feature h3{margin:0 0 7px;font-size:15px;line-height:1.45;color:#273546;word-break:keep-all;overflow-wrap:break-word}
.help-dialog p{margin:0;font-size:12px;font-weight:400;line-height:1.85;color:#607084;word-break:normal;overflow-wrap:break-word}
.help-rule{display:flex;align-items:center;gap:12px;padding-top:16px}
.help-rule svg{flex:none;width:28px;height:28px;fill:none;stroke:#8294ad;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.help-rule p{font-size:11px;line-height:1.65}
@media(max-width:360px){.help-feature{grid-template-columns:64px minmax(0,1fr);gap:13px;padding:18px 0}.help-feature h3{font-size:14px}.help-dialog p{font-size:11px}}
@media(max-width:420px){.encyclopedia-entry{--home-icon-size:40px;--home-icon-gap:10px}}

.noads-dialog{width:min(360px,calc(100vw - 28px));background:#fff;overflow-y:auto}
.noads-dialog .home-dialog-header{position:relative;justify-content:center;min-height:58px;padding-bottom:14px;border-bottom:1px solid #e5eaf0}
.noads-dialog h2{letter-spacing:.08em;text-align:center}
.noads-dialog #noads-close{position:absolute;top:0;right:0}
.noads-dialog p{margin:0;text-align:center;word-break:normal;overflow-wrap:break-word}
.noads-lead{font-size:17px;font-weight:700;line-height:1.7;color:#273546}
.noads-note{padding-top:10px;font-size:12px;line-height:1.8;color:#607084}

.encyclopedia-entry #noads-open{padding:0}
.encyclopedia-entry #noads-open svg{width:34px;height:34px;overflow:visible}

.noads-dialog-icon{display:block;width:104px;height:104px;margin:20px auto;overflow:visible;fill:none;stroke-linecap:round;stroke-linejoin:round}

.noads-dialog .noads-support{margin-top:20px;padding:14px 12px;border:1px solid #000;border-radius:12px;background:#fff;font-size:14px;font-weight:700;line-height:1.8;color:#273546}

.noads-dialog .noads-purchase{display:block;width:100%;min-height:48px;margin-top:22px;padding:10px;border:1px solid #2869dc;border-radius:9px;background:#2869dc;color:#fff;font-size:24px;font-weight:700;line-height:1.2;font-variant-numeric:tabular-nums;box-shadow:0 5px 0 #174795;margin-bottom:5px}
.noads-dialog .noads-purchase:disabled{opacity:1;cursor:default}
.noads-dialog .noads-purchase:not(:disabled):active{transform:translateY(4px);box-shadow:0 1px 0 #174795}

.noads-dialog .noads-purchase:disabled{background:#8293ad;border-color:#8293ad;box-shadow:0 5px 0 #53647c}
.noads-dialog .noads-restore{display:block;margin:18px auto 0;padding:9px 16px;border:1px solid #bec8d7;border-radius:8px;background:#fff;color:#273546;font-size:14px;min-height:44px}
.noads-dialog .noads-restore[hidden]{display:none}
.noads-dialog .noads-status{margin-top:14px;font-size:12px;line-height:1.6;color:#526275;min-height:1.6em}
/* Give secondary dialog actions the same 3px depth as the primary action. */
.home-dialog-actions>button:not(.primary){box-shadow:var(--button-shadow)}
.home-dialog-actions>button:not(:disabled):active{transform:translateY(var(--button-depth));box-shadow:none}

/* Keep the shared circular hit target; enlarge only the question mark. */
.encyclopedia-entry #help-open svg{width:28px;height:28px}

/* Give white button labels a subtle shadow without affecting dark labels. */
.primary:not(.room-primary):not(.scout-primary):not(.halloween-mission),.primary.halloween-boss,.noads-dialog .noads-purchase:not(.tickets-reward-button){text-shadow:0 1px 2px #17273d66}

/* Reuse the HOME panel, close button and button depth for the settings sheet. */
.settings-dialog{--settings-safe-top:env(safe-area-inset-top,0px);--settings-safe-right:env(safe-area-inset-right,0px);--settings-safe-bottom:env(safe-area-inset-bottom,0px);--settings-safe-left:env(safe-area-inset-left,0px);width:min(360px,calc(100vw - 28px));overflow-y:auto;overscroll-behavior:contain}
.settings-toggles{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px}
.settings-language{display:grid;gap:7px;margin-top:14px;padding-top:14px;border-top:1px solid #d5dce3}
.settings-language label{font-size:13px;font-weight:700}
.settings-language select{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:9px 12px;border:1px solid #9eafc5;border-radius:8px;background:#fff;color:#273546;font:inherit;font-size:16px;line-height:1.35;cursor:pointer}
.settings-language select:focus-visible{outline:2px solid #2869dc;outline-offset:2px}
.settings-dialog:not([data-keyboard-focus=true]) :is(button,select):focus{outline:none}


/* Launch controls are the first content in the shared how-to-play dialog. */
.help-dialog{width:min(560px,calc(100vw - 28px))}
.help-section{padding:22px 0;border-bottom:1px solid #e5eaf0;min-width:0}
.help-section-title{margin:0 0 14px;font-size:16px;line-height:1.5;color:#273546}
.help-dialog p{font-size:13px;line-height:1.75}
.help-section>p+p{margin-top:8px}
.help-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;list-style:none;padding:0;margin:0 0 16px}
.help-steps li{min-width:0}
.help-steps img{display:block;width:100%;height:auto;border:1px solid #dce3eb;border-radius:10px;background:#f5f7fa}
.help-steps h4{display:flex;align-items:flex-start;gap:6px;margin:10px 0 0;font-size:13px;line-height:1.55;color:#273546}
.help-step-number{display:grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;background:#2869dc;color:#fff;font-size:11px;font-variant-numeric:tabular-nums}
.help-steps p{margin-top:6px;font-size:12px}
.help-controls .help-note{font-size:12px}
.help-local-note{padding:10px 12px;border-radius:8px;background:#f0f5fb}
.help-abilities{padding-bottom:0}
.help-abilities .help-feature:last-child{border-bottom:0}
.help-feature h4{margin:0 0 7px;font-size:15px;line-height:1.45;color:#273546;overflow-wrap:break-word}
.help-stages-intro{border-bottom:0}
@media(max-width:479px){
 .help-steps{grid-template-columns:1fr;gap:12px}
 .help-steps li{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;gap:12px}
 .help-steps h4{margin-top:0}
 .help-steps p{font-size:11px;line-height:1.65}
}
@media(max-width:360px){
 .help-steps li{grid-template-columns:96px minmax(0,1fr);gap:10px}
 .help-steps h4{font-size:12px}
 .help-feature h4{font-size:14px}
 .help-dialog p{font-size:12px}
 .help-section{padding:18px 0}
 .help-abilities{padding-bottom:0}
}

.help-setting-name{white-space:nowrap}
.help-inline-gear{display:inline-block;width:1.15em;height:1.15em;margin:0 .22em 0 .08em;vertical-align:-.2em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}

/* HOME mode labels share flat text; retain the existing button depth and art. */
#setup :is(.start-actions,.mission-actions) button,#setup :is(.start-actions,.mission-actions) button :is(span,small){text-shadow:none}
