#shop-overlay{position:relative;z-index:120}.shop-backdrop{position:fixed;inset:0;background:#0b0e0ddb;display:grid;place-items:center;padding:24px;backdrop-filter:blur(5px)}.shop-window{width:min(1040px,100%);max-height:calc(100dvh - 48px);display:grid;grid-template-rows:auto auto minmax(0,1fr);background:#daccaa;color:#30291d;border:2px solid #a88c58;box-shadow:0 24px 100px #0009;border-radius:9px;overflow:hidden}.shop-header{display:flex;align-items:center;gap:24px;padding:22px 26px;border-bottom:1px solid #8c764b55}.shop-header h2{font:400 var(--type-heading)/1.2 var(--serif);margin-right:auto}.shop-wallet{display:flex;align-items:center;gap:8px;font-size:var(--type-body)}.shop-currency-icon{width:38px;height:38px;border-radius:50%;object-fit:cover}.shop-close{width:36px;height:36px;background:transparent;color:#30291d;font-size:var(--type-heading);border:1px solid #8c764b55;border-radius:4px}.shop-tabs{display:flex;gap:5px;padding:12px 22px;background:#c9b98f}.shop-tabs button{padding:10px 15px;background:transparent;border:1px solid transparent;color:#4f432e;font-size:var(--type-body);border-radius:4px}.shop-tabs button.selected{background:#e8ddbf;border-color:#927a4d;font-weight:600}.shop-content{padding:24px;overflow:auto;min-height:0}.shop-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.shop-item{display:flex;flex-direction:column;gap:13px;min-width:0;border:1px solid #9c83534d;border-radius:6px;padding:18px;background:#e8ddbf}.shop-item h3{font-size:var(--type-body);font-family:var(--serif);font-weight:700}.shop-item p{font-size:var(--type-body);line-height:1.5}.shop-item-wide{display:grid;grid-template-columns:minmax(130px,220px) minmax(0,1fr);align-items:center;gap:28px;min-height:280px}.shop-item-wide>div{display:flex;flex-direction:column;align-items:flex-start;gap:16px}.shop-art{width:100%;aspect-ratio:1;object-fit:contain;mix-blend-mode:multiply}.shop-skin-preview{width:100%;aspect-ratio:1;object-fit:cover;border-radius:4px}.shop-item .shop-buy{margin-top:auto;width:100%;min-height:42px;font-size:var(--type-body);background:#73532c;color:#fff6dc;border-color:#73532c;box-shadow:none;padding:10px 14px}.shop-item .shop-buy:hover:not(:disabled){background:#8a6637}.shop-item .shop-buy:disabled{opacity:.45}.shop-item .shop-note{font-size:var(--type-caption);color:#6c5a3d}.shop-detail{font-weight:600}.shop-context{font-size:var(--type-body);padding:12px 15px;margin-bottom:18px;background:#f1e7c8;border-left:3px solid #9d7c43}.shop-status{font-size:var(--type-body);margin-top:16px;min-height:1.5em;color:#564323}.shop-status:empty{min-height:0;margin:0}.shop-ad-progress{width:100%;height:6px;background:#98846155;overflow:hidden;border-radius:4px}.shop-ad-progress i{display:block;height:100%;background:#76633e;width:100%;animation:shopAd var(--ad-duration) linear both}@keyframes shopAd{from{transform:scaleX(0);transform-origin:left}to{transform:scaleX(1);transform-origin:left}}.resource-plus{display:inline-grid;place-items:center;min-width:23px;height:23px;padding:0;border:1px solid var(--line);border-radius:50%;font-size:var(--type-body);background:#d7c18b12;color:var(--gold)}.resource-plus:hover{background:#d7c18b33}.drag-ghost{pointer-events:none;box-shadow:0 18px 42px #0008}.is-drag-source{opacity:.35}.is-drop-valid{outline:1px dashed #ccb47c88;outline-offset:3px}.is-dragover{outline:2px solid #ebd096;box-shadow:0 0 24px #e1c27a44}.is-drop-invalid{outline-color:#b75c4e}.is-dropped{animation:shopDrop .35s ease-out}@keyframes shopDrop{from{transform:translateY(-12px) scale(1.04)}to{transform:translateY(0) scale(1)}}html[data-card-skin="ember"]{--card-skin-accent:#b36c47}html[data-card-skin="moon"]{--card-skin-accent:#7b80aa}html[data-card-skin="thorn"]{--card-skin-accent:#7c8a53}html[data-card-skin]:not([data-card-skin="default"]) .ally-card{outline:1px solid var(--card-skin-accent);outline-offset:2px}
@media(max-width:760px){.shop-backdrop{padding:10px}.shop-window{max-height:calc(100dvh - 20px)}.shop-header{padding:16px;gap:12px}.shop-tabs{padding:8px;gap:0}.shop-tabs button{padding:9px 10px;font-size:var(--type-caption);flex:1}.shop-content{padding:14px}.shop-items{grid-template-columns:1fr}.shop-item-wide{grid-template-columns:100px minmax(0,1fr);gap:15px;padding:14px;min-height:0}.shop-item{padding:14px}.shop-skin-preview{max-height:190px;object-fit:contain}.shop-header h2{font-size:var(--type-heading)}}

/* The shop uses the same quiet hierarchy as the game. */
.shop-header{padding:18px 22px;gap:16px}
.shop-header h2{font-family:var(--serif);font-size:var(--type-heading);font-weight:400;line-height:1.2}
.shop-wallet strong{font-family:var(--sans);font-size:var(--type-body);font-weight:600}
.shop-currency-icon{width:30px;height:30px}
.shop-close{width:32px;height:32px;min-width:32px;min-height:32px;display:grid;place-items:center;padding:0;border-radius:4px;line-height:1;font-family:var(--sans);font-size:var(--type-heading);font-weight:400}
.shop-tabs{padding:10px 18px;gap:5px}
.shop-tabs button{font-size:var(--type-body);font-weight:400;line-height:1.3;padding:9px 12px}
.shop-tabs button.selected{font-weight:600}
.shop-content{padding:20px}
.shop-items{gap:14px}
.shop-item{padding:16px;gap:12px;box-shadow:none}
.shop-item h3{font-family:var(--sans);font-size:var(--type-body);font-weight:600;line-height:1.3}
.shop-item p{font-family:var(--sans);font-size:var(--type-body);font-weight:400;line-height:1.45}
.shop-item-wide{grid-template-columns:minmax(100px,160px) minmax(0,1fr);gap:22px;min-height:220px}
.shop-item-wide>div{gap:13px}
.shop-item .shop-note,.shop-item .shop-detail{font-size:var(--type-caption);font-weight:400;line-height:1.4}
.shop-item .shop-buy{font-family:var(--sans);font-size:var(--type-body);font-weight:600;min-height:48px;line-height:1.3}
.shop-item .shop-buy:disabled{opacity:1;background:#c8bb9a;border-color:#b3a07a;color:#685d46}
.shop-skin-preview{max-height:190px;object-fit:contain}
.shop-skin-preview[src^="assets/shop/holiday-"]{aspect-ratio:3/1;height:auto;max-height:none;object-fit:contain}
.shop-item.is-context-target{border-color:#7b6535;outline:2px solid #9b7c3f;outline-offset:2px;box-shadow:inset 0 0 0 1px #b39760}
/* LC-064: state text and burn duration come from the commerce controller. */
.shop-attention-mark{display:inline-grid;place-items:center;flex:0 0 18px;min-width:18px;height:18px;padding:0 3px;border:1px solid #a58d5e;border-radius:50%;background:#253027;color:#e6d4ad;font-family:var(--sans);font-size:var(--type-caption);font-weight:600;line-height:1;letter-spacing:0;vertical-align:middle;pointer-events:none}
.shop-attention-mark[data-shop-attention="ready"]{border-color:#d8b873;background:#e7cc93;color:#342a17}
.shop-attention-mark[data-shop-attention="seen"]{border-color:#8b958777;background:#273028;color:#aeb7a8}
.shop-attention-mark[data-shop-attention="cooldown"]{border-style:dashed;border-color:#8d9da8;background:#253039;color:#c1ced8}
.shop-attention-mark[data-shop-attention="error"]{border-color:#e1a18c;background:#492e29;color:#f4d0c0;border-radius:4px}
.shop-attention-mark[hidden]{display:none}
.shop-attention-mark.is-burning[data-shop-attention="ready"]{animation:shopAttentionGlow var(--shop-attention-burn-duration,0s) ease-out 1}
.resource-plus{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-size:0;line-height:1}
/* LC-086: draw the sign independently of the font's baseline and glyph metrics. */
.resource-plus::after{content:"";position:absolute;top:50%;left:50%;width:10px;height:10px;transform:translate(-50%,-50%);background:linear-gradient(currentColor,currentColor) center/2px 100% no-repeat,linear-gradient(currentColor,currentColor) center/100% 2px no-repeat;pointer-events:none}
.resource-plus[data-commerce-entry]{position:relative}
.resource-plus[data-commerce-entry]>.shop-attention-mark{position:absolute;top:-5px;right:-5px}
@media(max-width:999px){.resource-plus[data-commerce-entry]>.shop-attention-mark{top:6px;right:6px}}
@keyframes shopAttentionGlow{0%,100%{box-shadow:0 0 0 0 #dbc08400}45%{box-shadow:0 0 0 3px #dbc08455,0 0 12px #dbc08466}}
@media(prefers-reduced-motion:reduce){.shop-attention-mark.is-burning[data-shop-attention="ready"]{animation:none}}
/* LC-065: secondary entry, independent of the main start/restart CTA. */
.commerce-entry[data-commerce-entry]{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;max-width:100%;min-height:28px;margin:0;padding:5px 8px;border:1px solid var(--line);border-radius:4px;background:transparent;color:var(--muted);font-family:var(--sans);font-size:var(--type-caption);font-weight:400;line-height:1.3;letter-spacing:0;text-align:left;white-space:normal;vertical-align:middle;box-shadow:none}
.commerce-entry[data-commerce-entry]:hover{border-color:var(--gold);color:var(--text);background:#d7c18b12}
.commerce-entry[data-commerce-entry]:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.title-data .commerce-entry[data-commerce-entry]{margin-left:8px}
.result-modal .commerce-entry[data-commerce-entry]{margin-bottom:12px}
@media(max-width:999px){.commerce-entry.secondary[data-commerce-entry]{min-height:48px}}
/* LC-066: success decoration follows a committed operation, never a render. */
[data-commerce-feedback]{position:relative}
[data-commerce-feedback]>.commerce-feedback{position:absolute;inset:5px;z-index:1;overflow:hidden;pointer-events:none;border:1px solid #9b8353;border-radius:4px;opacity:0}
[data-commerce-feedback="purchase"]>.commerce-feedback{border:2px double #8e6b34}
[data-commerce-feedback="grant"]>.commerce-feedback{border-color:#5a7548}
[data-commerce-feedback="equip"]>.commerce-feedback{border-color:#6f7899;border-style:dashed}
[data-commerce-feedback="holiday"]>.commerce-feedback{border-color:#ab8750;background:linear-gradient(#c5a267,#c5a267) left top/18px 2px no-repeat,linear-gradient(#c5a267,#c5a267) left top/2px 18px no-repeat,linear-gradient(#c5a267,#c5a267) right bottom/18px 2px no-repeat,linear-gradient(#c5a267,#c5a267) right bottom/2px 18px no-repeat}
[data-commerce-feedback].is-feedback-active>.commerce-feedback{animation:commerceReceiptMark var(--commerce-feedback-duration,0s) ease-out 1 both}
.commerce-feedback .commerce-spark{position:absolute;top:10px;right:10px;width:4px;height:4px;background:#b39052;border-radius:1px;opacity:0;pointer-events:none}
[data-commerce-feedback].is-feedback-active>.commerce-feedback .commerce-spark{animation:commerceReceiptSpark var(--commerce-feedback-duration,0s) ease-out var(--spark-delay,0s) 1 both}
@keyframes commerceReceiptMark{0%{opacity:0}25%,65%{opacity:1}100%{opacity:0}}
@keyframes commerceReceiptSpark{0%{opacity:0;transform:translate(0,0) rotate(0deg)}25%{opacity:.75}100%{opacity:0;transform:translate(var(--spark-x,0px),var(--spark-y,0px)) rotate(var(--spark-angle,0deg))}}
@media(prefers-reduced-motion:reduce){[data-commerce-feedback].is-feedback-active>.commerce-feedback{animation:none;opacity:1}[data-commerce-feedback].is-feedback-active>.commerce-feedback .commerce-spark{animation:none;display:none}}
.shop-context{font-size:var(--type-caption);font-weight:400;line-height:1.45;padding:10px 12px;margin-bottom:16px}
.shop-status{font-size:var(--type-body);font-weight:400;line-height:1.4}
.shop-pass-entry{font-family:var(--sans);font-size:var(--type-body);font-weight:400;line-height:1.25;padding:8px 10px;border:1px solid #9b855a;border-radius:4px;background:transparent;color:#4a3d28;max-width:220px}
#shop-overlay button:focus-visible{outline:2px solid #4f633b;outline-offset:3px}
@media(max-width:760px){.shop-header{padding:14px;gap:10px}.shop-tabs{padding:8px}.shop-tabs button{font-size:var(--type-caption);padding:9px 7px}.shop-content{padding:14px}.shop-item-wide{grid-template-columns:96px minmax(0,1fr);gap:14px;min-height:0}.shop-pass-entry{max-width:140px;font-size:var(--type-caption)}}

/* Stable shop frame: changing tabs changes only the local scroll content. */
.shop-window{
  height:min(760px,calc(100vh - 48px));height:min(760px,calc(100dvh - 48px));
  min-height:0;max-height:calc(100dvh - 48px);
}
.shop-header{min-width:0;flex-wrap:wrap}
.shop-header h2{flex:1;min-width:0;margin:0;overflow-wrap:anywhere}
.shop-wallet{min-width:0;flex-wrap:wrap}
.shop-wallet strong{overflow-wrap:anywhere}
.shop-close{flex:none;width:40px;height:40px;min-width:40px;min-height:40px}
.shop-tabs{min-width:0;flex-wrap:wrap}
.shop-tabs button{min-width:0;min-height:40px;white-space:normal;overflow-wrap:anywhere}
.shop-content{min-width:0;overscroll-behavior:contain;scrollbar-gutter:stable;scroll-padding:16px}
.shop-item :is(h3,p),.shop-status,.shop-context{overflow-wrap:anywhere}
.shop-book-link{max-width:220px;white-space:normal;overflow-wrap:anywhere}
.shop-item[data-shop-item="memory"] :is(.meta-summary,.meta-level-track,.meta-preview){width:100%}
.shop-item[data-shop-item="memory"] :is(.meta-summary,.meta-summary span,.meta-metric,.meta-note){color:#66553b}
.shop-item[data-shop-item="memory"] .meta-next{color:#604422}
.shop-item[data-shop-item="memory"] .meta-level-step:not(.is-complete):not(.is-current){color:#66553b}
.shop-item[data-shop-item="memory"] .meta-level-step.is-current{color:#604422;border-color:#806132}

/* Shared cosmetic tiles in the shop and book; full art lives in the detail. */
.shop-items:has(>.cosmetic-tile){grid-template-columns:repeat(auto-fill,minmax(min(200px,100%),1fr))}
.cosmetic-tile{
  --cosmetic-accent:#8b744c;position:relative;display:grid;
  grid-template-columns:minmax(0,1fr) 72px;grid-template-rows:auto auto minmax(0,1fr);
  gap:7px 10px;align-content:start;min-width:0;min-height:145px;padding:14px;
  border:1px solid #a18a5f;border-left:4px solid var(--cosmetic-accent);border-radius:5px;
  background:#eee1c2;color:#352c20;text-align:left;font-family:var(--sans);
}
.cosmetic-tile[data-accent="ember"],.cosmetic-tile[data-id="ember"]{--cosmetic-accent:#985b3e}
.cosmetic-tile[data-accent="moon"],.cosmetic-tile[data-id="moon"]{--cosmetic-accent:#566c89}
.cosmetic-tile[data-accent="thorn"],.cosmetic-tile[data-id="thorn"]{--cosmetic-accent:#627447}
.cosmetic-tile[data-accent="spring"],.cosmetic-tile[data-id="spring"]{--cosmetic-accent:#71814a}
.cosmetic-tile[data-accent="winter"],.cosmetic-tile[data-id="winter"]{--cosmetic-accent:#747fa5}
.cosmetic-tile[data-accent="harvest"],.cosmetic-tile[data-id="harvest"]{--cosmetic-accent:#a17a32}
.cosmetic-tile[data-accent="halloween"],.cosmetic-tile[data-id="halloween"]{--cosmetic-accent:#ad6d3a}
.cosmetic-tile-art{
  grid-column:2;grid-row:1/span 3;align-self:start;display:block;width:72px;height:90px;
  object-fit:contain;object-position:top right;
}
.cosmetic-tile[data-cosmetic-type="theme"] .cosmetic-tile-corner{
  grid-column:2;grid-row:1/span 3;align-self:start;display:block;
  width:72px;height:72px;overflow:hidden;
}
.cosmetic-tile-corner>.cosmetic-tile-art{
  width:300%;height:300%;max-width:none;max-height:none;
  object-fit:cover;object-position:left top;
}
.cosmetic-tile-name{grid-column:1;padding-left:24px;font-size:var(--type-body);font-weight:600;line-height:1.3}
.cosmetic-tile-type,.cosmetic-tile-state{grid-column:1;font-size:var(--type-caption);line-height:1.4;color:#68583e}
.cosmetic-tile :is(span,strong){min-width:0;white-space:normal;overflow-wrap:anywhere}
.cosmetic-tile-symbol{position:absolute;left:14px;top:14px;display:grid;place-items:center;width:18px;height:18px;color:var(--cosmetic-accent);font-size:var(--type-body);font-weight:600}
.cosmetic-tile[aria-pressed="true"]{
  outline:2px solid var(--cosmetic-accent);outline-offset:2px;
  border-top-style:double;border-bottom-style:double;background:#f4e8ca;
}
.cosmetic-tile[aria-pressed="true"] .cosmetic-tile-state{font-weight:600;color:#493c29}
.cosmetic-tile:focus-visible{outline:3px solid #365b50;outline-offset:3px}
.cosmetic-tile[data-owned="false"],.cosmetic-tile[data-owned="false"]:hover{
  min-height:145px;background:#dfdfd3;
}
.cosmetic-tile[data-owned="false"] .cosmetic-tile-art{filter:grayscale(.55)}
.cosmetic-tile[data-owned="false"]::after{
  content:"";position:absolute;right:10px;bottom:10px;width:24px;height:24px;
  border:1px solid #858b7b;border-radius:4px;background-color:#eeeade;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f5847' stroke-width='1.8'%3E%3Crect x='5' y='10' width='14' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3M12 14v3'/%3E%3C/svg%3E");
  background-size:18px 18px;background-position:center;background-repeat:no-repeat;
  pointer-events:none;
}

#shop-detail-overlay{position:relative;z-index:180}
.shop-detail-backdrop{position:fixed;inset:0;z-index:180;display:grid;place-items:center;padding:24px;background:#10170fdd}
.shop-detail-dialog{
  display:flex;flex-direction:column;width:min(720px,100%);min-height:0;
  max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);overflow:hidden;
  border:2px solid #a18a5f;border-radius:6px;background:#e9dabb;color:#352c20;
  box-shadow:0 20px 80px #0008;font-family:var(--sans);font-size:var(--type-body);
}
.shop-detail-header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:none;padding:16px 20px;border-bottom:1px solid #99805a66}
.shop-detail-header h3{min-width:0;margin:0;font:400 var(--type-heading)/1.2 var(--serif);overflow-wrap:anywhere}
.shop-detail-header button{flex:none;display:grid;place-items:center;min-width:40px;min-height:40px;padding:5px;background:#f4e9ce;color:#352c20;border:1px solid #99805a;border-radius:4px}
.shop-detail-body{display:flex;flex-direction:column;gap:12px;min-height:0;min-width:0;padding:20px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.shop-detail-preview{display:block;width:100%;height:auto;max-height:340px;object-fit:contain;align-self:center}
.shop-detail-theme-preview{position:relative;display:grid;place-items:center;min-width:0;isolation:isolate}
.shop-detail-theme-preview>.shop-detail-vignette{
  position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;
  pointer-events:none;
}
.shop-detail-body :is(p,span,strong){min-width:0;white-space:normal;overflow-wrap:anywhere}
.shop-detail-footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;flex:none;padding:12px 20px;border-top:1px solid #99805a66;background:#daccaa}
.shop-detail-footer button{min-height:40px;max-width:100%;padding:9px 14px;border:1px solid #73532c;border-radius:4px;background:#73532c;color:#fff4d8;font-family:var(--sans);font-size:var(--type-body);line-height:1.35;white-space:normal;overflow-wrap:anywhere}
.shop-detail-footer button:disabled{background:#cabd9e;color:#6b604a;border-color:#ac9871;cursor:not-allowed}
.shop-detail-dialog button:focus-visible{outline:3px solid #365b50;outline-offset:3px}
@media(hover:hover){.cosmetic-tile:hover{background:#f3e6c8;border-color:var(--cosmetic-accent)}}
@media(max-width:760px){
  .shop-window{height:calc(100vh - 20px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}
  .shop-tabs button{flex:1 1 100px}
  .shop-detail-backdrop{padding:10px}
  .shop-detail-dialog{max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px)}
  .shop-detail-header{padding:12px 14px}
  .shop-detail-body{padding:14px}
  .shop-detail-footer{padding:10px 14px}
  .shop-detail-preview{max-height:40dvh}
}
@media(max-width:500px){
  .shop-header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 10px}
  .shop-header h2,.shop-wallet,.shop-book-link{grid-column:1}
  .shop-close{grid-column:2;grid-row:1;align-self:start}
  .cosmetic-tile{min-height:130px}
}
@media(prefers-reduced-motion:reduce){
  .cosmetic-tile,.shop-detail-dialog *{animation:none!important;transition:none!important;scroll-behavior:auto}
}

/* Actual resource receipts are transient and never block the next action. */
#resource-toast-layer{position:fixed;inset:0;z-index:350;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:8px;padding:16px 16px max(32px,env(safe-area-inset-bottom));pointer-events:none}
.resource-toast{display:inline-flex;align-items:center;justify-content:center;gap:10px;max-width:calc(100vw - 32px);padding:10px 18px;border:1px solid #cbb17a;border-radius:8px;background:#202a22;color:#f4e8cf;box-shadow:0 8px 28px #0007;animation:resourceReceiptIn .2s ease-out both}
.resource-toast-icon{display:block;width:32px;height:32px;object-fit:contain}
.resource-toast-value{font:600 var(--type-body)/1.2 var(--sans);font-variant-numeric:tabular-nums}
@keyframes resourceReceiptIn{from{opacity:0;transform:translateY(12px) scale(.95)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.resource-toast{animation:none}}
