/* The shop ledger: an authored open book (assets/ui/book/book.png, 480x320 shown at exactly 2x) with cloth bookmark
   tabs on its right edge. Cards, buttons and bars use the shared pixel UI kit; CSS only places them on the pages. */
.shop-book { position:absolute; inset:0; z-index:70; background:rgba(18,12,8,.62); pointer-events:auto; color:var(--ink); font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif; font-size:15px; line-height:1.55; }
.shop-book[hidden] { display:none; }
.book-open #play-hud { visibility:hidden; }
.book { position:absolute; left:-10px; top:64px; width:960px; height:640px; }
.book-art { position:absolute; inset:0; width:960px; height:640px; image-rendering:pixelated; pointer-events:none; }
/* Pages: the left page stops short of the ribbon by the spine. */
.book-page { position:absolute; top:122px; height:432px; display:flex; flex-direction:column; gap:10px; padding:0 4px 6px 0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#a68b62 transparent; }
.book-page::-webkit-scrollbar { width:5px; }
.book-page::-webkit-scrollbar-thumb { background:#a68b62; }
.book-page:focus-visible { outline:2px solid #93754c; outline-offset:3px; }
.book-page.is-left { left:80px; width:330px; }
.book-page.is-right { left:540px; width:362px; }
.book-head { position:absolute; left:80px; right:58px; top:64px; height:48px; display:flex; align-items:center; gap:16px; }
.book-title { flex:1; min-width:0; margin:0; font-family:"Songti SC","STSong","Noto Serif CJK SC",serif; font-size:36px; font-weight:600; line-height:1.25; color:#7a2e22; letter-spacing:4px; }
.book-summary { flex:0 0 230px; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:baseline; gap:0 10px; margin:0; padding:0; line-height:1.3; font-variant-numeric:tabular-nums; }
.book-summary dt { color:#725a40; font-size:14px; }
.book-summary dd { margin:0; min-width:0; text-align:right; white-space:nowrap; font-size:18px; font-weight:600; color:#7a2e22; }
.book-summary .book-summary-income { color:#365e46; }
.book-btn.book-close { flex:none; min-width:96px; }
.book-note { position:absolute; left:80px; right:58px; bottom:56px; margin:0; min-height:24px; font-size:14px; line-height:1.5; color:#2f6b45; text-align:left; pointer-events:none; }
/* Bookmark tabs: cloth ribbons sticking out of the right edge; the chosen one is red and pulled further out. */
.book-tabs { position:absolute; left:922px; top:84px; display:flex; flex-direction:column; gap:8px; }
.book-tab { position:relative; width:112px; height:48px; padding:0 0 0 22px; border:0; background:transparent; color:#f7e3bd; font-family:"Songti SC","STSong","Noto Serif CJK SC",serif; font-size:21px; line-height:1.3; text-align:left; cursor:pointer; transform:translateX(-12px); transition:transform .12s steps(3); }
.book-tab.is-on { transform:none; }
.book-tab:hover:not(.is-on) { transform:translateX(-6px); }
.book-tab-art { position:absolute; inset:0; width:112px; height:48px; image-rendering:pixelated; }
.book-tab .is-on, .book-tab.is-on .is-off { display:none; }
.book-tab.is-on .is-on { display:block; }
.book-tab span { position:relative; text-shadow:0 2px 0 rgba(40,20,10,.55); }
.book-tab:focus-visible { outline:3px solid #ffe8b1; outline-offset:2px; }
body.reduced-motion .book-tab { transition:none; }
/* Cards on the pages. */
.book-card { position:relative; isolation:isolate; display:flex; flex:0 0 auto; flex-direction:column; gap:6px; min-width:0; padding:12px 14px; font-size:15px; line-height:1.55; overflow-wrap:anywhere; }
.book-card b { font-family:"Songti SC","STSong","Noto Serif CJK SC",serif; font-size:22px; font-weight:600; line-height:1.35; }
.book-card small { font-size:13px; line-height:1.5; color:#725a40; }
.book-card .book-line { color:#5b4330; }
.book-card.is-hero { align-items:flex-start; }
.book-big { font-size:36px !important; line-height:1.2 !important; color:#943d2b; font-variant-numeric:tabular-nums; }
.book-card.is-goal .book-btn { align-self:flex-end; }
.book-room { width:100%; height:auto; aspect-ratio:4 / 3; object-fit:cover; image-rendering:auto; }
.book-room:not(.is-large) { max-height:64px; object-position:50% 20%; }
.book-room.is-large { height:116px; object-position:50% 55%; }
.book-card.is-shop-stage { gap:4px; }
.book-description { color:#5b4935; font-size:14px; line-height:1.55; }
.book-upgrade { display:grid; grid-template-columns:auto 1fr; gap:3px 10px; align-items:baseline; margin-top:5px; padding-top:8px; border-top:1px solid #b99c6e; }
.book-card .book-upgrade-name { font-size:18px; }
.book-upgrade > .book-description,.book-upgrade > .book-effect { grid-column:1 / -1; }
.book-effect { font-size:14px; line-height:1.5; color:#365e46; font-variant-numeric:tabular-nums; }
.book-active-figures { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:3px 0; }
.book-active-figures dt { color:#725a40; font-size:13px; }
.book-active-figures dd { margin:2px 0 0; color:#365e46; font-size:23px; line-height:1.25; font-variant-numeric:tabular-nums; }
.book-card .book-active-limit { border-top:1px solid #c8b18b; padding-top:6px; }
.book-goal-estimate { color:#365e46; font-size:14px; line-height:1.55; font-variant-numeric:tabular-nums; }
.book-goal-options { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 8px; }
.book-goal-options > small { min-width:0; }
.book-goal-options > .book-btn { flex:none; min-height:28px; padding:3px 8px; }
.book-goal-options .book-button-label { font-size:12px; }
.book-goal-options > .book-goal-series { flex:1 1 100%; text-align:left; }
.book-goal-series .book-button-label { white-space:normal; }
.book-goal-details { flex:1 1 100%; color:#6c5841; font-size:12px; line-height:1.5; }
.book-goal-details summary { width:fit-content; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.book-goal-details summary:focus-visible { outline:2px solid #365e46; outline-offset:3px; }
.book-goal-details > small { display:block; margin-top:4px; font-size:12px; font-variant-numeric:tabular-nums; }
.book-ladder { display:grid; grid-template-columns:repeat(6, 1fr); gap:4px; margin:0; padding:0; list-style:none; }
.book-ladder li { display:grid; gap:3px; justify-items:center; font-size:11px; line-height:1.35; color:#78644b; }
.book-ladder li:not(.is-reached) img { opacity:.55; }
.book-ladder li.is-reached { opacity:1; color:#5b4330; }
.book-ladder img { width:34px; height:26px; object-fit:cover; }
/* Machine card: icon left, figures right, a row of two-line buttons underneath. */
.book-card.is-machine { display:grid; grid-template-columns:72px minmax(0,1fr); grid-template-rows:auto auto; column-gap:10px; row-gap:8px; padding:10px 12px; font-size:14px; }
.book-machine { width:72px; height:72px; image-rendering:pixelated; grid-row:1; }
.book-machine-body > b { font-size:20px; }
.book-machine.is-locked { filter:brightness(.15) sepia(1); opacity:.6; }
.book-machine-body { display:flex; flex-direction:column; gap:2px; min-width:0; }
.book-machine-return { color:#365e46; font-size:14px; line-height:1.5; }
.book-machine-body .book-machine-payback { font-size:12px; line-height:1.5; }
.book-machine-planning { grid-column:1 / -1; display:flex; flex-direction:column; gap:2px; border-top:1px solid #c8b18b; padding-top:5px; }
.book-machine-milestone { color:#5b4330; font-size:13px; line-height:1.4; }
.book-machine-planning .book-machine-milestone-return,.book-machine-planning .book-machine-decision { color:#365e46; font-size:12px; line-height:1.5; }
.book-actions { grid-column:1 / -1; display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; }
.book-page.is-left .book-card.is-machine { padding:6px 10px; }
.book-page .book-card.is-machine:only-child { flex:none; }
/* Decorations and series. */
.book-card.is-decor { display:grid; grid-template-columns:56px minmax(0,1fr) 82px; gap:10px; align-items:center; min-height:108px; padding:14px; }
.book-decor { grid-column:1; width:56px; height:64px; object-fit:contain; }
.book-decor-copy { grid-column:2; display:flex; flex-direction:column; gap:3px; min-width:0; }
.book-decor-copy > b { font-size:20px; line-height:1.35; }
.book-card.is-decor > .book-btn, .book-card.is-decor > .book-owned { grid-column:3; text-align:center; }
/* The authored paper spans the complete card, including the icon, outside grid placement. */
.book-card.is-decor > .raster-surface { grid-area:auto; }
.book-thumbs { display:flex; gap:4px; min-height:40px; align-items:center; }
.book-thumb { width:30px; height:40px; image-rendering:pixelated; object-fit:contain; }
.book-thumb.is-locked { display:grid; place-items:center; background:url("assets/px/icons/question.png") center / 24px no-repeat; color:transparent; }
.book-printing { font-size:12px; color:#9a8064; }
.book-card.is-series { gap:5px; padding:10px 14px; }
.book-card.is-series .book-btn { align-self:flex-start; min-width:82px; }
.book-card.is-collection-link,.book-card.is-collection-entry { gap:4px; }
.book-card.is-collection-link .book-btn,.book-card.is-collection-entry .book-btn,.book-card.is-collection-intro .book-btn { align-self:flex-start; }
.book-card.is-collection-intro,.book-card.is-collection-progress,.book-card.is-collection-exhibition,.book-card.is-collection-group { gap:6px; padding:10px 12px; }
.book-card.is-collection-intro b,.book-card.is-collection-exhibition b { font-size:20px; }
.book-collection-tickets { display:flex; flex-direction:column; gap:0; list-style:none; padding:0; margin:2px 0; }
.book-collection-tickets li { display:flex; align-items:center; gap:9px; min-width:0; padding:7px 0; border-top:1px solid #c8b18b; }
.book-collection-thumb { width:29px; height:43px; object-fit:contain; flex:none; }
.book-collection-ticket-copy { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.book-collection-ticket-copy strong { font-size:18px; line-height:1.4; color:#493929; }
.book-collection-ticket-copy small { font-size:15px; line-height:1.4; }
.book-collection-mark { flex:none; font-size:14px; line-height:1.4; color:#755e43; font-variant-numeric:tabular-nums; }
.book-collection-ticket-actions { display:flex; flex:none; flex-direction:column; align-items:flex-end; gap:4px; }
.book-collection-ticket-actions .book-btn { min-width:86px; padding:4px 6px; }
.book-collection-ticket-actions .book-button-label { font-size:14px; }
.is-collection-group .book-description,.is-collection-progress .book-description,.is-collection-intro .book-description { font-size:16px; }
.is-collection-progress > small,.is-collection-exhibition > small { font-size:15px; }
.book-collection-tickets .is-complete .book-collection-mark { color:#365e46; font-weight:600; }
.book-collection-award { display:flex; justify-content:space-between; align-items:baseline; gap:8px; padding:6px 0; border-top:1px solid #c8b18b; }
.book-collection-award strong { font-size:15px; color:#69543b; }
.book-collection-award span { text-align:right; font-size:12px; line-height:1.4; color:#725a40; }
.book-collection-award.is-earned strong,.book-collection-award.is-earned span { color:#365e46; }
.book-owned { font-style:normal; font-size:14px; color:#2f6b45; }
.book-warn { font-size:14px; color:#943d2b; }
.book-empty { font-size:18px; color:#7a5a3a; }
/* Bars and buttons. */
.book-bar { display:block; height:8px; background:url("assets/ui/bar-frame.png") center / 100% 100% no-repeat; image-rendering:pixelated; }
.book-bar i { display:block; height:100%; background:url("assets/ui/bar-fill.png") left center / 16px 100% repeat-x; image-rendering:pixelated; }
.book-btn { position:relative; isolation:isolate; min-width:0; min-height:38px; padding:6px 10px; border:0; background:transparent; font:inherit; font-size:14px; line-height:1.4; color:#f7e3bd; cursor:pointer; }
.book-button-label { font-size:14px; }
.book-btn.has-price { display:grid; justify-items:center; align-content:center; gap:2px; min-height:52px; padding:7px 6px; }
.book-btn.has-price small { font-size:14px; font-weight:600; color:#ffe6b0; line-height:1.35; white-space:nowrap; font-variant-numeric:tabular-nums; }
.book-btn:disabled { opacity:1; color:#604b34; cursor:default; }
.book-btn:disabled > .raster-surface { opacity:.38; }
.book-btn.has-price:disabled small { color:#67472d; }
.book-actions .book-button-label,.book-actions .book-btn.has-price small { font-size:12px; }
.book-btn:hover:not(:disabled) { filter:brightness(1.1); }
.book-btn:focus-visible { outline:3px solid #ffe8b1; outline-offset:2px; }
/* Page turning within a tab. */
.book-pager { position:absolute; right:58px; bottom:56px; display:flex; align-items:center; gap:10px; }
.book-pager[hidden] { display:none; }
.book-count { font-size:14px; color:#725a40; min-width:36px; text-align:center; }
.book-note { right:300px; }
/* Growth pages keep numerical progress, the action, and its reward on the same paper card. */
.book-talent-heading { display:flex; align-items:baseline; justify-content:space-between; gap:10px; min-width:0; }
.book-talent-heading > b { min-width:0; }
.book-talent-heading > small,.book-talent-rank { flex:none; font-size:14px; color:#725a40; font-variant-numeric:tabular-nums; }
.book-card.is-growth-level,.book-card.is-rush { padding:10px 12px; gap:5px; }
.book-card.is-growth-entry { gap:4px; }
.book-card.is-growth-entry .book-btn { align-self:flex-start; }
.book-growth-actions { display:grid; grid-template-columns:1.35fr 1fr; gap:8px; margin-top:3px; }
.book-growth-actions .book-btn.has-price small { font-size:12px; }
.book-rush-value { font-family:"Songti SC","STSong","Noto Serif CJK SC",serif; font-size:26px; line-height:1.3; color:#943d2b; font-variant-numeric:tabular-nums; }
.book-card.is-rush .book-btn { align-self:flex-start; min-width:132px; }
.book-card.is-order,.book-card.is-talent { padding:8px 12px; gap:4px; }
.book-card.is-order b,.book-card.is-talent b { font-size:21px; }
.book-order-progress { flex:none; font-size:13px; line-height:1.4; color:#725a40; font-variant-numeric:tabular-nums; }
.book-card-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.book-card-foot .book-effect { min-width:0; font-size:13px; }
.book-card-foot .book-btn { flex:none; min-width:70px; }
.book-talent-condition { min-width:0; }
.book-card.is-talent-build { gap:8px; }
.book-card.is-talent-build .book-btn { align-self:flex-start; min-width:112px; }
.book-card.is-moment { gap:5px; padding:12px 14px; }
.book-card.is-moment > .book-btn { align-self:flex-end; min-width:84px; }
.book-moment-amount { color:#943d2b; font-size:24px; line-height:1.25; font-variant-numeric:tabular-nums; }
.book-card.is-moment-empty { gap:10px; }

/* The leaderboard lives on the same authored paper as the rest of the ledger. */
.book-card.is-ranking-entry { gap:5px; }
.is-ranking-entry > .book-btn,.is-ranking-consent > .book-btn,.is-ranking-mine > .book-btn { align-self:flex-start; }
.book-card.is-ranking-intro { gap:5px; padding:10px 12px; }
.book-card.is-ranking-intro > b { font-size:23px; }
.book-card.is-ranking-controls { gap:8px; padding:10px 12px; }
.book-ranking-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.book-ranking-periods { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.book-ranking-choices .book-btn,.book-ranking-periods .book-btn { min-height:39px; padding:6px; }
.book-ranking-choices [aria-pressed="true"],.book-ranking-periods [aria-pressed="true"] { color:#fff0c6; font-weight:700; }
.book-card.is-ranking-results { gap:10px; min-height:105px; padding:12px; }
.book-ranking-heading { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.book-ranking-heading > b { font-size:23px; }
.book-ranking-heading > small { flex:none; }
.book-ranking-list { list-style:none; margin:0; padding:0; }
.book-ranking-list li { display:grid; grid-template-columns:26px minmax(0,1fr) auto; align-items:baseline; gap:7px; padding:8px 0; border-bottom:1px solid #c8b18b; font-size:14px; line-height:1.5; }
.book-ranking-list li:last-child { border-bottom:0; }
.book-ranking-list li.is-mine { color:#28573c; font-weight:700; }
.book-ranking-place { color:#855b36; font-variant-numeric:tabular-nums; }
.book-ranking-name { overflow-wrap:anywhere; }
.book-ranking-value { max-width:116px; text-align:right; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.book-ranking-message { margin:7px 0; font-size:17px; color:#725a40; }
.book-card.is-ranking-consent { gap:8px; padding:10px 12px; }
.book-card.is-ranking-mine { gap:8px; }
.book-ranking-records { display:grid; gap:0; margin:0; }
.book-ranking-records > div { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:12px 0; border-bottom:1px solid #c8b18b; }
.book-ranking-records > div:last-child { border-bottom:0; }
.book-ranking-records dt { font-size:15px; color:#725a40; }
.book-ranking-records dd { margin:0; font-size:23px; line-height:1.3; color:#943d2b; font-variant-numeric:tabular-nums; }
