/* Stillfire 0.25 — a living journey. Original chapter art and game geometry retained. */
:root{--ui-ink:#f5efdf;--ui-muted:#bdcdc7;--ui-line:#dbca9b40;--ui-gold:#efd699;--ui-deep:#081b23;--ui-radius:18px}
[hidden]{display:none!important}
button,a,summary{-webkit-tap-highlight-color:transparent}
button:not(.tile):not(.mosaic-piece),a,summary{touch-action:manipulation}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #fff0b9;outline-offset:4px}
button:not(.tile):not(.mosaic-piece){transition:background 160ms,border-color 160ms,box-shadow 160ms,transform 160ms}
button:not(.tile):not(.mosaic-piece):not(:disabled):active{transform:translateY(1px)}
button:disabled{cursor:default}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body{color:var(--ui-ink);background:#06151c}
.masthead{height:72px;padding-inline:24px;max-width:1440px}
.masthead nav{gap:8px}.masthead .iconbutton,.masthead .navbutton{min-width:48px;min-height:48px}
.profile-button{min-height:48px;padding:10px 16px;border:1px solid var(--ui-line);border-radius:28px;background:#e7d3a20a;color:var(--ui-ink);font:600 13px Arial,sans-serif}
body:not(.playing-page) #journalButton,body:not(.playing-page) #shopButton{display:none}
.story-pages{max-width:1440px;width:100%;margin:0 auto;border:0}
.chapter-menu{position:relative;display:grid;grid-template-columns:1fr;gap:0;background:#081c24}
.journey-resources{display:flex;align-items:center;gap:10px;padding:8px 24px;border-block:1px solid #e9d7ab14;background:#0c222a}
.journey-resources button{font:600 13px/1.3 Arial,sans-serif;min-height:48px;padding:10px 16px;border:1px solid #c5d9ce26;border-radius:24px;color:#f5e4b8;background:#d8e4ca08}
.journey-resources>span{font:12px/1.4 Arial,sans-serif;color:#b7c7c1;margin-left:auto}
.chapter-menu>.world{position:relative;top:auto;width:100%;height:clamp(540px,calc(100svh - 220px),920px);min-height:540px;max-height:none;border:0;isolation:isolate;overflow:hidden}
.world .forest{object-position:50% 48%}.world .scene{position:absolute;inset:0}
.world .scene-vignette{background:linear-gradient(90deg,#03151ede 0%,#051a1d55 60%,transparent),linear-gradient(0deg,#061a23 0%,transparent 70%)}
.world:after{content:'';position:absolute;inset:18px;pointer-events:none;border:1px solid #e4c98c30;border-radius:3px;z-index:2;background:linear-gradient(90deg,#eed29400,#eed29450,#eed29400) top center/160px 1px no-repeat}
.world .chapter-tag{top:32px;left:40px;font-size:11px}.world .view-world{width:48px;height:48px;right:34px;top:30px;background:#051a23a8;z-index:3}
.world-caption{position:absolute;left:7%;right:7%;bottom:48px;max-width:570px;z-index:3}
.world-caption .journey-chapter{font:600 12px/1.5 Arial,sans-serif!important;letter-spacing:1.7px;color:#f0d797!important;max-width:none!important;margin:0 0 10px}
.world-caption>.eyebrow{display:none}
.world h1{font:clamp(42px,5.4vw,78px)/1.02 Georgia,serif;letter-spacing:-1.6px;margin:0 0 18px;text-shadow:0 3px 32px #0008;color:#fff2d9}
.world-caption #worldStory{font:16px/1.55 Georgia,serif;color:#d3dfd5;max-width:430px;margin:0 0 20px}
.restoration{margin:0 0 22px;font:12px/1.4 Arial,sans-serif;color:#d4dfd6;gap:14px}.progress-line{height:4px;max-width:240px;border-radius:4px;overflow:hidden;background:#fff1c02b}.progress-line>span{border-radius:4px}
.journey-actions{display:grid;gap:7px;max-width:380px}
.journey-actions .primary{width:100%;min-height:58px;margin:0;border-radius:13px;font:700 16px/1.3 Arial,sans-serif;padding:16px 20px;box-shadow:0 7px 28px #0005,inset 0 1px #fff7d6}
.journey-secondary{display:flex;justify-content:space-between;align-items:center;min-height:48px;padding:12px 4px;color:#ece4cd;font:14px/1.4 Arial,sans-serif;text-align:left}
.journey-milestone{font:12px/1.5 Arial,sans-serif!important;color:#bbcec6!important;margin:8px 0 0!important;max-width:440px!important}
#linkedProgress{font:12px/1.5 Arial,sans-serif;margin:5px 0;color:#c8e8e9}
.chapter-menu>.app-card{margin:0;padding:16px 24px;background:#10242a;border:0;border-top:1px solid var(--ui-line)}
.app-card-brand img{width:40px;height:40px}.app-card h2{font-size:17px}
.journey-nav{position:sticky;bottom:0;z-index:15;margin:0 auto;display:grid;grid-template-columns:repeat(3,1fr);max-width:1440px;padding:6px 14px max(7px,env(safe-area-inset-bottom));border-top:1px solid #daca9852;background:#071c24f5;box-shadow:0 -10px 32px #00101844;backdrop-filter:blur(16px)}
.journey-nav button{min-height:58px;color:#b8cdc4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font:12px/1.3 Arial,sans-serif;border-radius:12px;border:1px solid transparent}
.journey-nav button>span{font:22px/1 Georgia,serif}.journey-nav button[aria-current=page]{background:linear-gradient(#e6ce9219,#e6ce9205);border-color:#d8c28b3d;color:#ffe7ae}
.site-footer{padding:12px 24px;font-size:9px;letter-spacing:1px;color:#adbbb5}
.journal-open .chapter-menu>.world{height:240px;min-height:240px}.journal-open .world-caption{bottom:25px}.journal-open .world h1{font-size:34px;margin:0}.journal-open .world-caption #worldStory,.journal-open .world-caption .restoration,.journal-open .journey-actions,.journal-open .journey-milestone{display:none}
.journal-open .chapter-tag{display:none}.journal-open .world-caption .journey-chapter{font-size:11px!important}
.chapter-select{padding:28px clamp(18px,5vw,64px) 40px;background:radial-gradient(ellipse at top,#31564944,transparent 70%),#0b2129}
.chapter-menu-heading h2{font-size:32px;margin:8px 0 22px}.chapter-choices{gap:12px}.chapter-choice{border-radius:14px;overflow:hidden;border:1px solid #c7c99744;min-height:130px}.chapter-choice[aria-pressed=true]{border-color:#f1d596;box-shadow:0 0 0 1px #f1d59644,inset 0 -35px 50px #05202a88}
.chapter-select .dialog-intro{font:15px/1.6 Arial,sans-serif;color:#c9d9ce}.book-progress{font:13px/1.5 Arial,sans-serif!important;padding:14px;border:1px solid #e3cf9440;border-radius:10px;background:#e3cf9408}
.page-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.page-entry{min-height:88px!important;padding:15px;border-radius:12px;background:linear-gradient(135deg,#aac5b50c,#061b2444);border:1px solid #d1cda42e;text-align:left}
.page-entry strong{font-size:17px}.page-entry small{font:12px/1.5 Arial,sans-serif;color:#b5c7c0}.page-entry .page-num{font:23px Georgia,serif;color:#e8d3a1}
.page-entry.current-page{border-color:#f3d291;box-shadow:inset 3px 0 #efd393,0 4px 16px #0002}.page-entry.restored-page .entry-symbol{color:#c9edce}.page-entry.locked-page{opacity:.65}.stage-select-title{font-size:11px}
.cover-enter{position:relative;z-index:5;min-height:52px;width:min(310px,80vw);border-radius:12px;font:700 15px/1.4 Arial,sans-serif;margin:0}
.start-invitation>span{font-size:11px}.start-screen{gap:12px;padding-bottom:max(18px,env(safe-area-inset-bottom))}.start-screen .closed-book-stage{width:clamp(135px,min(69vw,calc((100svh - 340px)*.7)),330px)}
/* Gameplay: minimum touch targets; wrapped labels can grow their controls. */
.playing-page .masthead{height:52px;min-height:52px;flex-basis:52px}.playing-page .masthead .iconbutton{width:48px;height:48px;min-height:48px}
.playing-page #accountButton,.playing-page #journalButton,.playing-page #settingsButton{display:none}
.level-page .puzzle-heading h2{font-size:clamp(22px,5.7vw,28px)}.level-page .puzzle-heading p{font-size:13px;line-height:1.4}
.level-page .puzzle-top .eyebrow{font-size:10px}.level-page .board-status{font-size:12px;height:auto;min-height:20px;line-height:1.4;gap:8px;flex-wrap:wrap}
.level-page .toolstrip{height:auto;min-height:50px;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.level-page .toolstrip button{min-width:0;min-height:50px;font-size:14px;line-height:1.35;overflow-wrap:anywhere;border-radius:12px;border:1px solid #c7d5bf42;background:linear-gradient(#c3ddc416,#779c8810);box-shadow:inset 0 1px #e8efdb15}
.level-page #resetButton{color:#afc3bc;border-color:transparent;background:none;font-size:12px;order:3}.level-page #hintButton{border-color:#e1c78765;color:#f4dda4}
.level-page .puzzle-footer>span{display:none}.level-page .puzzle-footer{height:48px;justify-content:flex-end}.level-page .puzzle-footer #helpButton,.level-page .puzzle-footer .quick-sound{min-height:48px;height:48px;font-size:12px}.level-page .puzzle-footer #helpButton{width:48px;min-width:48px}
.level-page .pair-key{height:48px;min-height:48px;border-radius:9px}.level-page .pair-key>span>strong{font-size:11px}
.level-page .tutorial-guide{height:auto;min-height:70px;padding:10px 12px;border-radius:10px}.tutorial-top>strong{font-size:12px;line-height:16px}.tutorial-guide p{font-size:12px;line-height:16px}.tutorial-top>span{font-size:10px}
.mosaic-tools button{min-height:50px;font-size:14px;border-radius:12px}#bossRestart{order:3;background:none;color:#b6c9c1}
/* Resolution-independent surface detail; no artwork resampling. */
.board-shell{box-shadow:0 16px 45px #0007,inset 0 1px #eefbe642,inset 0 -2px #0007!important;background:radial-gradient(ellipse at 20% 0%,#b9d9bd26,transparent 55%),linear-gradient(145deg,#1c383d,#06181f)!important}
.board-shell:before{pointer-events:none}.tile:not(.stone){box-shadow:inset 0 1px #ebfff526,inset 1px 0 #e4ffd410,inset 0 -2px #0005,0 2px 5px #0003}.tile.active{box-shadow:inset 0 1px #ffefb84d,inset 0 0 18px #edd79112,0 2px 5px #0003}
.mosaic-frame{box-shadow:0 18px 50px #0008,inset 0 1px #fff0c87a}
/* One panel language across accounts, supplies and settings. */
dialog{border:1px solid #dbc58b59;border-radius:22px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;background:radial-gradient(ellipse at 20% 0%,#264b4666,transparent 70%),#0b222b;color:#f4edda;padding:26px;box-shadow:0 28px 90px #000a,inset 0 1px #f6e4b224;overscroll-behavior:contain}
dialog::backdrop{background:#020e17bf;backdrop-filter:blur(8px)}dialog .iconbutton{min-width:48px;min-height:48px}dialog .dialog-intro,dialog>p{font-size:14px;line-height:1.6}
#shopDialog{width:640px}#shopDialog .dialog-head{margin-bottom:12px}.supply-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:5px;background:#04161b;border-radius:13px;margin:14px 0}
.supply-tabs button{min-height:50px;font:600 13px/1.3 Arial,sans-serif;color:#bfd0c6;border-radius:9px;padding:8px}.supply-tabs button[aria-pressed=true]{color:#ffedc1;background:#315048;border:1px solid #d3c38b55}
.billing-status{border:0;padding:0}.billing-status p{font-size:13px;line-height:1.55;color:#c7d4cc}.paid-packs{gap:12px;margin:16px 0}.paid-pack{padding:18px 14px;border-radius:16px;background:radial-gradient(ellipse at 0 0,#ddc78e1c,transparent),#102d34}.paid-pack h4{font-size:21px}.paid-pack p{font-size:13px;min-height:42px}
.billing-status .paid-pack button{min-height:52px;border-radius:10px;background:linear-gradient(120deg,#f2d99d,#c9a866);color:#132820;font-size:15px;font-weight:700;box-shadow:inset 0 1px #fff0c8}
.billing-status .purchase-check{opacity:1;min-height:48px;color:#e5d3a6;background:#d6d6a30a;margin:10px 0;width:100%}
.billing-status #paidGuest{opacity:1;min-height:50px;width:100%;color:#f4e4bc;background:#b4d7c815;font-size:14px;margin:8px 0}
#paidSignIn{display:block;min-height:48px;padding:12px 0;font-size:14px}
.purchase-return-note{font-size:12px!important;color:#b2c6bc!important}.paid-inventory p{display:none}.paid-inventory .purchase-resume{padding:14px;border:1px solid #e8c98166;border-radius:12px;background:#caa75814;margin:10px 0}
#ownedSupplyPanel .lobby-inventory{padding:12px 0;border:0;background:none}#ownedSupplyPanel .inventory-heading .inventory-shop{display:none}.inventory-heading h2{font-size:24px}.inventory-item strong{font-size:25px}.inventory-item small{font-size:12px}.inventory-sync{display:none}.inventory-note{font-size:12px}.paid-tools{grid-template-columns:1fr}.paid-tools button{min-height:50px;font-size:14px}
#earnedShop>summary{display:none}#earnedShop{border:0;padding:0}.shop-item{min-height:84px;border-radius:12px}.shop-item strong{font-size:16px}.shop-item small,.shop-rules{font-size:13px!important;line-height:1.55}.shop-message{font-size:14px}.website-shop-link{font-size:13px;min-height:48px;padding:12px 0;display:block}
.settings-group{border:1px solid #d8d0a82d;border-radius:13px;padding:0 14px;margin:12px 0;background:#b5d2c407}.settings-group>summary{min-height:54px;padding:17px 0;font:600 15px/1.4 Arial,sans-serif;color:#efe3c3;cursor:pointer}.setting-row{gap:16px}.setting-row strong{font-size:15px}.setting-row p{font-size:13px}.setting-row .toggle{min-height:48px;min-width:52px}.danger-zone{border-color:#cf94713d}.danger-zone .primary{background:#a2604220;color:#efc9aa;border:1px solid #ce967655}
.pause-dialog,.confirm-dialog{width:400px;text-align:center}.pause-dialog h2,.confirm-dialog h2{font:32px/1.15 Georgia,serif}.pause-dialog>button,.confirm-dialog>button{display:block;width:100%;min-height:52px;margin:9px 0;padding:12px;border-radius:12px;border:1px solid #d3c39438;font-size:15px}.pause-dialog>p,.confirm-dialog>p{color:#c7d6cb}.confirm-dialog .quiet{color:#e9baa0}
/* Readability options are saved per player, including exported backups. */
.high-contrast{--muted:#dbe9de;--border:#d2d9b775}.high-contrast .scene-vignette{background:linear-gradient(0deg,#03141afb,#03141a33)!important}.high-contrast .tile .pipe{stroke:#c4e2d7}.high-contrast .tile.active .pipe{stroke:#ffe59a}.high-contrast .tile{outline:1px solid #b9d8c999}.high-contrast dialog,.high-contrast .chapter-select{background:#071b23}.high-contrast p,.high-contrast small{color:#dce9df}.high-contrast button{border-color:#d2d9b775}
.large-text .world-caption #worldStory,.large-text dialog p,.large-text .page-entry small,.large-text .setting-row p{font-size:16px;line-height:1.6}.large-text .journey-milestone,.large-text .book-progress{font-size:15px!important}.large-text .level-page .puzzle-heading p,.large-text .board-status,.large-text .tutorial-guide p{font-size:15px;line-height:1.5}.large-text .tutorial-guide{min-height:90px}.large-text .level-page .puzzle-top .eyebrow,.large-text .tutorial-top>strong{font-size:13px}.large-text .pair-key>span>strong{font-size:12px}
/* Short windows and enlarged text may scroll instead of crushing touchable puzzle tiles.
   Match the base body selector's specificity so its viewport lock cannot trap controls. */
@media(max-height:700px) and (max-width:479px),(max-width:360px){body.playing-page:not(.book-closed){overflow-y:auto;height:auto;min-height:100dvh}.playing-page #gameContent{height:auto;min-height:100dvh}.playing-page .story-pages{flex:auto}.story-pages>#puzzlePanel.level-page,.level-page{min-height:calc(100dvh - 52px);height:auto}.level-page .board-stage{container-type:inline-size;flex:none;min-height:0;padding:6px}.level-page .board-shell{width:100%;height:auto;max-height:none;aspect-ratio:1}.level-page .puzzle-footer{margin-top:4px}}
.large-text.playing-page:not(.book-closed){height:auto;overflow-y:auto;min-height:100dvh}.large-text.playing-page #gameContent{height:auto;min-height:100dvh}.large-text .level-page{height:auto;min-height:calc(100dvh - 52px)}.large-text .level-page .board-stage{container-type:inline-size;flex:none}.large-text .level-page .board-shell{width:100%;height:auto;aspect-ratio:1}
@media(max-width:760px){.masthead{padding:0 16px;height:64px}.masthead .wordmark span{font-size:22px;letter-spacing:3px}.masthead .wordmark small{font-size:7px}.masthead nav{gap:4px}.profile-button{padding:8px 12px}.journey-resources{padding:7px 16px;gap:7px}.journey-resources button{font-size:12px;padding:8px 12px}.journey-resources>span{font-size:10px;max-width:95px;text-align:right}.chapter-menu>.world{height:calc(100svh - 200px);min-height:535px}.world .forest{object-position:57% 38%}.world .scene-vignette{background:linear-gradient(0deg,#061a23 0%,#061a23d4 32%,#061a2300 85%)}.world-caption{left:25px;right:25px;bottom:30px;max-width:none}.world:after{inset:12px}.world .chapter-tag{top:24px;left:26px}.world .chapter-tag .tagline{display:none}.world .view-world{top:19px;right:21px}.world h1{font-size:48px}.world-caption #worldStory{font-size:15px;max-width:330px;margin-bottom:15px}.world-caption .journey-chapter{font-size:10px!important}.journey-actions{max-width:none}.restoration{margin-bottom:18px}.journey-milestone{font-size:11px!important}.journal-open .chapter-menu>.world{height:205px;min-height:205px}.journal-open .world h1{font-size:32px}.page-list{grid-template-columns:1fr}.chapter-choices{display:grid;grid-template-columns:1fr;gap:10px}.chapter-select .chapter-choice{min-height:105px;padding:16px}.chapter-select .chapter-choice strong{font-size:23px}.chapter-select{padding:24px 18px 30px}.journey-nav{padding-inline:12px}.site-footer{font-size:8px}.chapter-menu>.app-card{padding:14px 18px}.inventory-grid{gap:7px}.inventory-item{padding:10px 8px}.inventory-item strong{font-size:22px}.inventory-item small{font-size:11px}.inventory-label{font-size:11px}dialog{padding:22px 18px}.supply-tabs button{font-size:12px}}
@media(min-width:1800px){.story-pages,.journey-nav,.masthead{max-width:1800px}.chapter-menu>.world{height:900px;max-height:calc(100svh - 220px)}.world-caption{max-width:650px}.world h1{font-size:88px}.world-caption #worldStory{font-size:19px;max-width:540px}}
@media(prefers-reduced-motion:reduce){body:not(.allow-motion) *,body:not(.allow-motion) *:before,body:not(.allow-motion) *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
body.reduced-motion *,body.reduced-motion *:before,body.reduced-motion *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
/* The destination bar stays reachable even when installation help is present. */
body:not(.playing-page) #gameContent{padding-top:env(safe-area-inset-top,0px);padding-bottom:calc(80px + env(safe-area-inset-bottom))}
body:not(.playing-page) .masthead{padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px))}
@media(max-width:760px){body:not(.playing-page) .masthead{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}}
.journey-nav{position:fixed;left:50%;transform:translateX(-50%);width:100%;bottom:0}
.book-closed .journey-nav{visibility:hidden}
#accountDialog #accountSignOut{display:none}
#ownedSupplyPanel .paid-tools{display:none}
#shopDialog .paid-pack{padding:15px 12px;grid-template-columns:minmax(0,1fr) 108px;border-radius:14px}
#shopDialog .paid-pack h4{font-size:18px;line-height:1.3}#shopDialog .paid-pack p{font-size:13px;line-height:1.45}#shopDialog .paid-pack button{min-height:52px;font-size:14px;border-radius:10px}
#shopDialog .paid-packs{display:grid;grid-template-columns:1fr;gap:10px}
#pauseButton{font:600 20px Arial,sans-serif}
@media(max-width:760px){.chapter-menu>.world{min-height:480px;height:calc(100svh - 205px)}.world h1{font-size:44px}.world-caption{bottom:25px}.world-caption #worldStory{font-size:14px}.journey-milestone{margin-top:4px!important}.journey-actions .primary{min-height:54px}}
@media(max-height:560px) and (min-width:480px){.level-page .toolstrip,.level-page .toolstrip button{height:auto;min-height:44px}.level-page .puzzle-footer{height:44px}.level-page .puzzle-footer #helpButton,.level-page .puzzle-footer .quick-sound{height:44px;min-height:44px}.mosaic-tools button{height:auto;min-height:44px}}
.journey-nav svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
.profile-button[data-state=linked]:before{content:'✓';margin-right:7px;color:#cfedbe}
#pictureHelpDialog{width:400px}#pictureHelpDialog p{font-size:15px;line-height:1.6}#pictureHelpDialog .primary{width:100%;min-height:52px}

#shopDialog .paid-inventory p{display:none}
#accountDialog #lobbyLogout{min-height:50px;width:100%;margin-top:12px;border:1px solid #d6ca9b55;border-radius:12px;font-size:14px;color:#f0dbab}
@media(max-height:700px) and (max-width:479px),(max-width:360px){.mosaic-page .mosaic-stage{container-type:inline-size;flex:none}.mosaic-page .mosaic-frame{width:100%;height:auto}}
.large-text .mosaic-page .mosaic-stage{container-type:inline-size;flex:none}.large-text .mosaic-page .mosaic-frame{width:100%;height:auto}

.mosaic-tools{height:auto;min-height:50px}
@media(min-width:480px) and (max-height:560px){.mosaic-tools{height:auto;min-height:44px}}

/* Phone screenshot follow-up: one chapter label, clean focus handoff, visible milestone. */
#journeyChapter:focus{outline:none}
.world .chapter-tag{display:none}
.cover-edition{white-space:nowrap}
@media(max-width:760px){
 #browseChapters{display:none}
 .journey-resources{padding-block:3px}
 .chapter-menu>.world{min-height:420px;height:calc(100svh - 200px)}
 .world-caption{bottom:24px}
 .world h1{font-size:42px}
 .journey-milestone{margin-top:14px!important}
 .journal-open .chapter-menu>.world{height:205px;min-height:205px}
}
.large-text .chapter-menu>.world{min-height:560px}
.large-text.journal-open .chapter-menu>.world{min-height:230px}

/* Acknowledge purchased Whispers while the server confirms the move. */
:is(#hintButton,#bossWhisper,#undoButton,#bossUndo).assist-busy{opacity:1;color:#fff1c9;border-color:#efd294;background:#514932;cursor:progress}
:is(#hintButton,#bossWhisper,#undoButton,#bossUndo).assist-used{opacity:1;color:#fff5d8;border-color:#ffe2a3;box-shadow:inset 0 0 0 1px #ffe2a366,0 0 16px #eac77745}
:is(#hintButton,#bossWhisper,#undoButton,#bossUndo):active:not(:disabled){transform:scale(.97);filter:brightness(1.2)}
#board .tile.whispered,#mosaicBoard .whispered{outline:3px solid #ffe3a3;outline-offset:-4px;box-shadow:inset 0 0 24px #e6c36d66,0 0 12px #e6c36d55}

.resource-number{display:inline-block;min-width:.7em;font-size:var(--counter-size,1.18em);font-weight:750;font-variant-numeric:tabular-nums;transform-origin:50% 60%;color:var(--counter-color,#d0dbce);text-shadow:0 0 var(--counter-glow,0px) rgb(255 226 151 / var(--counter-glow-alpha,0));transition:font-size .25s ease,color .25s ease,text-shadow .25s ease}
.life-detail{display:block;font-size:.85em;font-weight:400;line-height:1.35}
.resource-number.counter-low{animation:counter-breathe 2.8s ease-in-out infinite}
.resource-number.counter-pulse{animation:counter-pop .75s ease-out}
@keyframes counter-pop{0%{transform:scale(1)}25%{transform:scale(1.12)}100%{transform:scale(1)}}
@keyframes counter-breathe{0%,100%{filter:brightness(1)}50%{filter:brightness(1.18)}}

/* A finished picture stays at its native frame size; the chapter seal is part of it. */
.mosaic-frame.is-solved .mosaic-inscription{padding-bottom:23%;background:linear-gradient(transparent 30%,#03181e22 55%,#03181ebd)}
.mosaic-frame.is-awakening .mosaic-piece,.mosaic-frame.is-awakening .mosaic-hole{animation:mosaic-merge .85s .15s forwards}
.mosaic-frame.is-awakening .mosaic-hole{animation:mosaic-fill .6s .12s both,mosaic-merge .85s .15s forwards}
.mosaic-frame.is-awakening .mosaic-piece:after{animation:mosaic-bevel-melt .8s .15s forwards}
.mosaic-frame.is-whole.has-living-art .mosaic-reference-painting{opacity:1}
.mosaic-frame.is-whole .mosaic-reference{opacity:1}
.mosaic-frame.is-whole .mosaic-piece.whispered{outline:0;box-shadow:none}
#bossNext.etched-chapter{position:absolute;z-index:6;bottom:6%;left:50%;transform:translateX(-50%);width:max-content;max-width:88%;min-height:48px;height:auto;padding:12px 22px;border:1px solid #d8bd7b;border-radius:8px;background:linear-gradient(135deg,#16392ee8,#102a27f2);box-shadow:inset 0 1px #ffefb255,inset 0 -2px #010f14aa,0 0 0 3px #15282090,0 4px 14px #0007;color:#f7dfa1;text-shadow:0 1px #000,-1px -1px #00170d;font:600 clamp(12px,3.8cqw,18px)/1.25 Georgia,serif;letter-spacing:.06em;opacity:0;pointer-events:none}
.is-whole #bossNext.etched-chapter{opacity:1;pointer-events:auto;animation:chapter-seal-etch .7s ease-out both}
#bossNext.etched-chapter:hover{border-color:#fff0bf;box-shadow:inset 0 1px #fff4c477,0 0 18px #edc36a55}
#bossNext.etched-chapter:active{transform:translateX(-50%) scale(.97)}
#bossNext.etched-chapter:focus-visible{outline:3px solid #fff0c5;outline-offset:4px}
@keyframes chapter-seal-etch{from{clip-path:inset(0 100% 0 0);filter:brightness(2)}to{clip-path:inset(0);filter:brightness(1)}}

/* Chapter IV — jade glass, warm ivory and rose-gold aurora. */
.aurora{--gold:#f3d99c;--paper:#fff0d3;--muted:#b2d4cb;--border:#92cbb149}
.aurora .puzzle-panel{background:radial-gradient(ellipse at 15% 0%,#416c5855,transparent 65%),radial-gradient(ellipse at 90% 80%,#b2777330,transparent 70%),#0c252b}
.aurora .masthead{background:linear-gradient(100deg,#122e31,#254239,#182b36);border-color:#d2bb7955}
.aurora .board-shell{border-color:#d9cc955f;background:linear-gradient(145deg,#50796555,#09262eee 48%,#b58a612c)}
.aurora .tile{background:linear-gradient(135deg,#406b5d66,#162f3dba);border-color:#d4c38b33}
.aurora .tile.active{background:radial-gradient(ellipse at 50% 40%,#8be6bb33,#153537 75%)}
.aurora .wind-gate-symbol rect{fill:#183d37;stroke:#d4d79f}
.aurora .wind-gate-symbol path{stroke:#e4f4c3}
.aurora .mosaic-frame{box-shadow:0 0 0 1px #f5dea1,0 0 0 5px #112f31,0 0 0 6px #8dd9b666,0 14px 38px #0007}
.aurora .page-icon,.aurora .puzzle-heading h2{color:#ffe5ae}

/* The astral reading room: ivory folios suspended above an indigo star chart. */
.aurora{--gold:#f1d49d;--paper:#f6eedb;--muted:#bbb7d5;--border:#c7b0e04a}
.aurora .puzzle-panel{background:linear-gradient(#100e29d9,#171a37ee),url('assets/aurora-archive.webp') center/cover}
.aurora .masthead{background:linear-gradient(100deg,#111329,#2f2846,#142d38);border-color:#e2c99466}
.aurora .board-shell{padding:12px;border:1px solid #ecd7a77d;border-radius:18px;background:radial-gradient(ellipse at 18% 20%,#68dcb035,transparent 48%),radial-gradient(ellipse at 90% 78%,#e7a6cb38,transparent 50%),#11162e;box-shadow:0 0 0 4px #121529,0 0 0 5px #b99b6555,0 14px 38px #0007,inset 0 0 45px #9a80d51c}
.aurora .board{gap:5px;background:radial-gradient(circle at 28% 38%,#e4d4a855 0 1px,transparent 2px),radial-gradient(circle at 74% 68%,#bbe8de55 0 1px,transparent 2px);background-size:37px 43px,53px 61px}
.aurora .tile{border:1px solid #d7c49a52;border-radius:5px 13px 5px 13px;background:linear-gradient(140deg,#51486388,#282641d9 48%,#172c3bcc);box-shadow:inset 3px 0 #dfc89514,inset 0 1px #fff0ca33,0 3px 8px #0005}
.aurora .tile.active{border-color:#f1d9a4a3;background:radial-gradient(ellipse at 30% 25%,#8ce9c245,#343049 72%);box-shadow:inset 0 0 16px #b2ffe51c,0 0 9px #bcecc31c}
.aurora .tile.stone{border-color:transparent;opacity:.72;background:#16182a55;box-shadow:none}
.aurora .archive-etching{opacity:.32}.aurora .active .archive-etching{opacity:.55}
.aurora .archive-shelf{opacity:.65}.aurora .active .archive-ink{animation:archive-current 2.4s linear infinite;filter:drop-shadow(0 0 2px #b7ffe0)}
.aurora .archive-lantern{filter:drop-shadow(0 3px 3px #050a22)}
.aurora .board-corner{border-color:#f2d8a1}.aurora .tutorial-guide{background:linear-gradient(110deg,#403950cc,#1b263dcc);border-color:#e6ce9666}
.aurora .toolstrip button{border-radius:7px 15px 7px 15px;background:#24253e99;border-color:#dbc6a34d}
.aurora .toolstrip #hintButton{background:linear-gradient(135deg,#65523d77,#244c4d88);color:#fff0c4;border-color:#e2c68b99}
.aurora .mosaic-frame{box-shadow:0 0 0 1px #f5dea1,0 0 0 5px #201d38,0 0 0 6px #bfa5d666,0 14px 38px #0007}
@keyframes archive-current{to{stroke-dashoffset:-32}}
@media(prefers-reduced-motion:reduce){.aurora .archive-ink{animation:none}}

/* The home reads like a book: player, bookmark, rewards, then other paths. */
.chapter-menu{--home-gutter:clamp(16px,3vw,40px)}
.chapter-menu>#playerProfile{margin:0;padding:12px var(--home-gutter);border:0;border-bottom:1px solid var(--ui-line);border-radius:0;background:#0b2229}
.chapter-menu>.game-mode-choice{padding:12px var(--home-gutter)}
.chapter-menu>.post-adventure-choices{margin:8px var(--home-gutter) 20px}
.journey-book-progress{font:11px/1.5 Arial,sans-serif!important;letter-spacing:1px;color:#c5d7ca!important;margin:0 0 14px!important}
.journey-actions .journey-bookmark{font:13px/1.5 Georgia,serif;color:#ede1c2;margin:0 0 3px;overflow-wrap:anywhere}
.journey-paths{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:6px var(--home-gutter) 18px;background:#0a2027}
.journey-paths>button{display:flex;align-items:center;gap:12px;min-width:0;min-height:88px;text-align:left;padding:16px;border:1px solid var(--ui-line);border-radius:12px;background:linear-gradient(120deg,#d4ac6612,#142c32);box-shadow:none;color:#f2e7c9}
.journey-paths>button:hover{border-color:#e8ce8e;background:#23423f}
.journey-paths>button>span:last-child{min-width:0}.journey-paths strong{display:block;font:18px/1.3 Georgia,serif}.journey-paths small{display:block;font:12px/1.5 Arial,sans-serif;color:#bed0c4;margin-top:5px}
.journey-paths svg,.journey-paths .path-symbol{width:28px;flex:none;color:#e7ca87;font-size:28px;text-align:center}
.chapter-menu .reward-emblem{width:28px;height:28px;object-fit:contain;border-radius:7px;flex:none}
body.journal-open .journey-paths,body.journal-open .journey-book-progress{display:none}
body.journal-open .chapter-menu>.journey-rewards,body.journal-open .chapter-menu>.game-mode-choice,body.journal-open .chapter-menu>.post-adventure-choices{display:none}
@media(max-width:760px){.journey-paths{grid-template-columns:1fr 1fr}.journey-paths #browseChapters{display:none}.journey-paths>button{flex-direction:column;align-items:flex-start;gap:9px;padding:14px;min-height:120px}.journey-paths strong{font-size:17px}.journey-paths small{font-size:12px}.chapter-menu>.world .world-caption{padding-top:68px}.journey-book-progress{font-size:10px!important}.chapter-menu .profile-heading button{font-size:12px}}
@media(max-width:340px){.journey-paths{grid-template-columns:1fr}.journey-paths>button{flex-direction:row;align-items:center;min-height:88px}}

/* Counters and the optional +5-turn control share a growing row. */
.level-page .economy-strip{height:auto;min-height:44px;padding-block:6px;flex-shrink:0}
.economy-strip>span,.economy-strip>b{min-width:0;flex:1 1 80px;overflow-wrap:anywhere}
.journey-paths strong,.journey-paths small{overflow-wrap:anywhere}
.reward-entry>span{min-width:0}.reward-entry strong,.reward-entry small{overflow-wrap:anywhere}
/* Keep the way back to play visible while a long panel scrolls. */
dialog > .dialog-head{position:sticky;top:0;z-index:5;background:#123238;padding:8px 0 10px;box-shadow:0 -12px 0 #123238,0 8px 12px #071c2470;border-bottom:1px solid #c7b97730}
dialog > .dialog-head .close-dialog{margin:0;min-width:44px;min-height:44px;align-self:flex-start;background:#102b31;border:1px solid #c7b97755;border-radius:50%}
