html:has(body.shop-page), .shop-page { overflow-x: clip; }
.shop-hero { padding-bottom: 18px; max-width: 980px; }
.shop-hero h1 { max-width: 14em; text-wrap: balance; }
.shop-eyebrow { display: inline-block; color: #a25326; font-size: 13px; font-weight: 650; letter-spacing: .08em; margin-bottom: 14px; }

/* Skin locker: a real Mac screen on the left, the skins on the right. */
.shop-market { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr); gap: 32px; align-items: start; margin-bottom: 40px; }
.shop-market-stage { position: sticky; top: 84px; min-width: 0; }
.shop-market-list { min-width: 0; }

/* The stage is drawn in macOS points; --pt maps one point to CSS pixels. */
.skin-stage { container-type: inline-size; width: 100%; }
.mac-frame {
  --bezel: 16;
  --pt: calc(100cqw / var(--crop-w, 920));
  /* Only the top bezel is in view; the screen continues left, right and down. */
  padding-top: calc(var(--bezel) * var(--pt)); background: #0b0b0d;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, #000 82%, transparent 100%);
  mask-composite: intersect;
}
.mac-viewport {
  position: relative; overflow: hidden;
  width: calc(var(--crop-w, 920) * var(--pt)); height: calc(var(--crop-h, 560) * var(--pt));
  background: #8fb1d9;
}
.mac-screen, .mac-screen > * {
  position: absolute; left: calc(var(--x, 0) * var(--pt)); top: calc(var(--y, 0) * var(--pt));
  width: calc(var(--w) * var(--pt)); height: calc(var(--h) * var(--pt));
}
.mac-screen { left: calc(var(--crop-x, 275) * -1 * var(--pt)); top: 0; }
.mac-wallpaper { object-fit: cover; object-position: center 25%; }
.mac-menubar { z-index: 2; image-rendering: auto; }
.mac-island-shell { z-index: 3; }
.mac-sprite { z-index: 4; image-rendering: pixelated; image-rendering: crisp-edges; }
.mac-sprite[hidden] { display: none; }
.mac-label {
  z-index: 5; width: auto !important; height: auto !important; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font-size: 11px; line-height: 1.5; font-weight: 600; letter-spacing: .01em;
  color: #fff; background: rgba(20, 20, 24, .58);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.mac-label[hidden] { display: none; }
.mac-stage-note { margin: 10px 2px 0; color: var(--muted, #6f706a); font-size: 12px; line-height: 1.5; }

.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-top: 4px; }
.stage-caption { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.stage-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-controls[hidden] { display: none; }
.stage-chip {
  border: 1px solid var(--line, #dfddd6); background: transparent; color: inherit; border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.stage-chip[aria-pressed="true"] { background: #1d1d1f; border-color: #1d1d1f; color: #fff; }
:root[data-theme="night"] .stage-chip[aria-pressed="true"] { background: #f2efe8; border-color: #f2efe8; color: #1d1d1f; }
.stage-chip:disabled { opacity: .45; cursor: default; }
.stage-chip:focus-visible, .skin-pick:focus-visible { outline: 2px solid #b66b3c; outline-offset: 2px; }
.stage-toggle { border-style: dashed; }
.shop-preview-note { margin: 10px 2px 0; color: var(--muted, #6f706a); font-size: 12px; line-height: 1.5; }

/* Skin list */
.shop-card-head, .shop-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.shop-section-heading h2 { margin: 0 0 12px; }
.skin-list { display: grid; gap: 10px; }
.skin-list + .skin-list { margin-top: 10px; }
.skin-list > .empty { padding: 20px 0; }
.skin-card { background: var(--paper, #fff); border: 1px solid var(--line, #dfddd6); border-radius: 18px; padding: 12px 14px 14px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.skin-card:has(.skin-pick[aria-pressed="true"]) { border-color: #d0743c; box-shadow: inset 0 0 0 1px #d0743c, 0 6px 18px rgba(208, 116, 60, .14); background: color-mix(in srgb, #d0743c 6%, var(--paper, #fff)); }
.skin-pick {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; margin: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 12px;
}
.skin-thumb { flex: none; width: 72px; height: 60px; object-fit: contain; image-rendering: pixelated; background: #ece9e2; border-radius: 12px; }
.skin-thumb[hidden] { display: none; }
.skin-pick-text { display: grid; gap: 2px; min-width: 0; }
.skin-pick-text strong { font-size: 16px; }
.skin-kind { color: var(--muted, #6f706a); font-size: 12px; }
.skin-note, .skin-status { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted, #6f706a); }
.skin-status { color: var(--ink, #1d1d1f); font-weight: 650; }
.shop-price { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.shop-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.shop-card-footer .button { min-height: 36px; max-width: 100%; white-space: normal; text-align: center; }

/* Wallet, stars and top-up */
.shop-stars { margin-top: 8px; max-width: 460px; }
.shop-stars-line { margin: 0; font-size: 15px; font-weight: 650; }
.shop-stars-line strong { font-variant-numeric: tabular-nums; }
.shop-stars-note { margin: 4px 0 0; color: var(--muted, #6f706a); font-size: 12px; line-height: 1.5; }
.shop-wallet { padding: 30px; background: var(--paper, #fff); border: 1px solid var(--line, #dfddd6); border-radius: 22px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.shop-wallet h2 { margin-top: 0; }
.shop-wallet > .inline-actions { align-self: start; }
.shop-balance { margin: 10px 0; font-size: 25px; font-weight: 650; font-variant-numeric: tabular-nums; }
.shop-offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; grid-column: 1 / -1; margin-top: 12px; }
.shop-offer { border: 1px solid var(--line, #dfddd6); border-radius: 14px; padding: 18px; }
.shop-offer h3 { margin: 0 0 7px; }
.shop-offer p { font-size: 14px; margin: 6px 0 14px; }
.shop-wallet > .notice { grid-column: 1 / -1; }
.shop-rules { margin: 28px 6px 0; color: var(--muted, #6f706a); font-size: 12px; line-height: 1.7; }

:root[data-theme="night"] .shop-eyebrow { color: #dda77d; }
:root[data-theme="night"] .skin-thumb { background: #2a2b28; }
:root[data-theme="night"] .mac-viewport { background: #1c2337; }

@media (max-width: 960px) {
  .shop-market { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .shop-market-stage { position: static; }
  .skin-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skin-list + .skin-list { margin-top: 10px; }
}
@media (max-width: 860px) {
  .shop-page .commerce-main { width: min(1120px, calc(100% - 28px)); }
  .shop-wallet { grid-template-columns: 1fr; padding: 20px; }
  .shop-offers { grid-template-columns: 1fr; }
  .shop-balance { font-size: 21px; }
}
@media (max-width: 560px) {
  .shop-page .commerce-main { width: min(1120px, calc(100% - 20px)); }
  .skin-list { grid-template-columns: minmax(0, 1fr); }
  .stage-caption { font-size: 17px; }
  .mac-label { font-size: 10px; padding: 1px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-page { scroll-behavior: auto; }
  .stage-chip, .skin-card { transition: none; }
}
