/* Approved camp / parchment concept. Isolated from expedition and battle screens. */
.ts-item:has(.ts-shop-hint) { position: relative; }
.ts-shop-hint { position: absolute; top: 63px; left: 52px; font-size: 24px; color: #b7b3a5; }
.camp-permanent { display: block; margin-top: 8px; color: #f0d49c; }
body.sheet-open:has(.meta-sheet:not([hidden])) { overflow: hidden; }
.sheet.meta-sheet { align-items: center; background: rgba(9,17,23,.55); padding: 18px 12px; }
body.sheet-open .meta-sheet .sheet-panel { width: 100%; max-width: 454px; height: min(91dvh, 850px); max-height: 94dvh; border: 11px solid #9a7850; border-image: var(--meta-frame-art) 18 stretch; border-radius: 0; color: #302018; background: #f1e4c9; background-image: var(--meta-paper-art); background-size: 72px 78px; box-shadow: 0 14px 50px #0008; animation: sheetUp .2s ease-out; }
body.sheet-open .meta-sheet .sheet-head { padding: 7px 15px 5px; border: 0; display: flex; flex: 0 0 auto; flex-direction: column; align-items: stretch; }
.meta-sheet .sheet-head h2 { text-align: center; font-size: 34px; margin: 3px 0 8px; color: #302018; }
.meta-sheet #sheet-close { order: -1; align-self: flex-start; padding: 5px 0; border: 0; background: none; font-size: 13px; min-height: 30px; color: #49372a; }
.meta-sheet .sheet-body { padding: 0 15px 18px; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #a48b62 transparent; }
.meta-sheet button { font-family: var(--f-body); cursor: pointer; }
.meta-sheet button:focus-visible { outline: 2px solid #8b3c24; outline-offset: 3px; }
.meta-sheet button:disabled { cursor: default; }
.meta-subtitle { text-align: center; font-size: 13px; margin: 0 0 14px; color: #6b5540; line-height: 1.7; }
.meta-wallet { display: flex; align-items: center; justify-content: center; gap: 11px; border: 1px solid #bba27a; box-shadow: inset 0 0 0 3px #fff7e34d; margin: 0 auto 15px; padding: 10px 20px; width: fit-content; font-size: 18px; }
.meta-wallet b { font-size: 25px; font-weight: 400; }
.meta-gem { width: 25px; height: 29px; image-rendering: pixelated; flex-shrink: 0; }
.meta-tabs { display: flex; border-bottom: 1px solid #aa8c63; gap: 5px; margin: 0 0 15px; }
.meta-tabs button { flex: 1; padding: 10px 5px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #6a543e; font-size: 15px; }
.meta-tabs button[aria-selected=true] { color: #963c25; border-color: #963c25; font-weight: 700; background: #fff6df55; }
.shop-items { display: grid; gap: 10px; }
.shop-categories { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin: -3px 0 12px; }
.shop-categories button { flex: 1; padding: 7px 2px; font-size: 12px; border: 1px solid #baa27f; background: #fff5de50; color: #6b5540; }
.shop-categories button[aria-pressed=true] { border-color: #a94e31; color: #8e3823; background: #fff6dfaa; }
.shop-item { width: 100%; display: grid; grid-template-columns: 45px 1fr auto; gap: 9px; align-items: center; padding: 13px 12px; border: 1px solid #baa27f; background: #fff9e426; text-align: left; color: inherit; box-shadow: inset 0 0 0 3px #fff8e72e; }
.shop-item[aria-pressed=true] { border: 4px solid #a5482e; border-image: var(--meta-selected-art) 9 stretch; padding: 10px 9px; background: #fff4d640; }
.shop-item > canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.shop-copy { display: grid; gap: 4px; }
.shop-copy strong { font-size: 17px; font-weight: 700; }
.shop-copy small { font-size: 13px; }
.shop-level { color: #7a6047; }
.shop-price { display: flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid #a88b65; background: #c2ad8b44; font-size: 16px; white-space: nowrap; }
.shop-item[aria-pressed=true] .shop-price { color: #fff4dd; background: #8c5033; border-color: #a4774b; }
.shop-price canvas { width: 18px; height: 18px; }
.shop-detail { text-align: center; border-top: 1px solid #b69c75; margin-top: 19px; padding-top: 13px; }
.shop-description { color: #6b5540; font-size: 13px; line-height: 1.7; margin: 0 0 9px; }
.shop-next { font-size: 15px; margin: 8px 0 14px; }
.meta-action { min-height: 44px; border: 1px solid #9a7650; padding: 10px 14px; color: #503726; background: #faf0da; box-shadow: inset 0 0 0 3px #e2ccb0; font-size: 14px; }
.meta-action.primary { background: #875034; color: #fff4df; border: 5px solid #573420; border-image: var(--meta-button-art) 8 stretch; box-shadow: none; }
.meta-action:disabled { background: #d3c5ad; color: #6c6051; box-shadow: inset 0 0 0 3px #dfd2be; border-color: #b2a086; }
.shop-buy { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 16px; padding: 7px 9px; }
.shop-note { font-size: 12px; line-height: 1.8; color: #705b46; text-align: center; margin: 14px 0 0; }
.meta-feedback { min-height: 1.7em; color: #873b25; margin: 10px 0 0; text-align: center; font-size: 13px; }
.shop-history { list-style: none; padding: 0; margin: 0; }
.shop-history li { padding: 12px 0; border-bottom: 1px solid #baa17c; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.ending-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 17px 0 9px; }
.ending-heading h3 { font-size: 21px !important; margin: 0 !important; border: 0 !important; padding: 0 !important; }
.ending-heading small { font-size: 12px; white-space: nowrap; }
.ending-progress { width: 100%; height: 5px; accent-color: #9a4e32; margin: 0 0 14px; display: block; }
.ending-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ending-pagination { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 10px 0 -5px; font-size: 12px; }
.ending-pagination button { background: none; border: 0; color: #80482f; min-height: 30px; }
.ending-pagination button:disabled { color: #9b8b76; }
.ending-card { position: relative; padding: 4px; background: #faf0db66; border: 1px solid #b4a083; color: #38271d; min-width: 0; }
.ending-card[aria-pressed=true] { outline: 2px solid #a3462a; outline-offset: 1px; }
.ending-thumb { width: 100%; height: 110px; object-fit: cover; display: block; image-rendering: pixelated; background: #18212a; }
.ending-card.locked .ending-thumb { filter: grayscale(1) brightness(.45); }
.ending-lock { position: absolute; top: 47px; left: calc(50% - 9px); width: 18px; height: 15px; background: #c4b08a; border: 2px solid #5b5143; }
.ending-lock::before { content: ''; position: absolute; width: 9px; height: 9px; border: 3px solid #c4b08a; border-bottom: 0; border-radius: 7px 7px 0 0; left: 2px; top: -11px; }
.ending-lock::after { content: ''; position: absolute; width: 3px; height: 6px; background: #594735; top: 4px; left: 6px; }
.ending-reader select { max-width: 100%; width: 100%; padding: 10px; border: 1px solid #ad916c; color: #493429; background: #f5e9cf; font-family: var(--f-body); font-size: 13px; }
.ending-card span.ending-caption { display: block; font-size: 13px; padding: 8px 2px 5px; line-height: 1.5; overflow-wrap: anywhere; }
.ending-detail { border-top: 1px solid #aa8e65; margin-top: 21px; padding: 12px 1px 0; }
.ending-detail h3 { border: 0 !important; font-size: 22px !important; margin: 0 0 8px !important; }
.ending-detail p { font-size: 14px; line-height: 1.9; margin: 8px 0 13px; }
.ending-actions { display: flex; gap: 10px; }
.ending-actions button { flex: 1; }
.ending-legacy { color: #705b46; font-size: 12px !important; }
.ending-reader { padding: 2px 0 10px; }
.ending-reader .reader-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.reader-head button { background: none; border: 0; color: #7d442c; padding: 7px 0; font-size: 14px; }
.reader-head small { font-size: 12px; }
.ending-reader h3 { font-size: 23px !important; border: 0 !important; margin-bottom: 12px !important; }
.ending-reader p { font-size: 16px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; }
.reader-nav button { flex: 1; }
.permanent-res { color: #357789; }
#game-screen .hud-res { flex-wrap: wrap; gap: 5px 12px; }
.end-permanent-reward { padding: 12px 8px; border-block: 1px solid #bda988; color: #357789; text-align: center; font-size: 14px; }
@media (max-width: 380px) {
 .sheet.meta-sheet { padding: 12px 9px; }
 body.sheet-open .meta-sheet .sheet-head { padding-inline: 10px; }
 .meta-sheet .sheet-body { padding-inline: 10px; }
 .meta-sheet .sheet-head h2 { font-size: 30px; }
 .shop-item { grid-template-columns: 33px 1fr auto; gap: 7px; padding: 13px 8px; }
 .shop-item[aria-pressed=true] { padding: 10px 5px; }
 .shop-item > canvas { width: 31px; height: 31px; }
 .shop-copy strong { font-size: 15px; }
 .shop-price { padding: 7px; }
 .ending-heading h3 { font-size: 18px !important; }
 .ending-thumb { height: 88px; }
 .ending-grid { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .meta-sheet .sheet-panel { animation: none; } }
