/*
  PLAYRS-ROOM-PREMIUM-V1 -- CLUBS ERA artifact room (/worlds/clubs-era/store/).
  Palette: black / white / off-white only. Same language as the hub
  (css/playrs-hub-v1.css) minus red: big bold title, hairlines, tiles,
  one status line, negative space.

  Visual layer only -- the purchase markup, ids, classes and every
  checkout hook in js/playrs-store-purchase-v2.js are unchanged in
  behavior; this file restyles them.
*/
body[data-store-scope="world"] {
  --room-bg: #0a0a0a;
  --room-panel: #111111;
  --room-ink: #efece5;          /* off-white: primary text */
  --room-white: #ffffff;        /* white: emphasis + filled actions */
  --room-dim: rgba(239,236,229,.62);
  --room-faint: rgba(239,236,229,.36);
  --room-line: rgba(239,236,229,.12);
  --room-line-2: rgba(239,236,229,.26);
  --room-hover: rgba(239,236,229,.06);
  --room-on-ink-dim: rgba(10,10,10,.6);   /* text on a filled (ink) unit */

  /* feed the existing store tokens so shared rules follow the palette */
  --playrs-store-bg: var(--room-bg);
  --playrs-store-fg: var(--room-ink);
  --playrs-store-muted: var(--room-dim);
  --playrs-store-line: var(--room-line);
  --playrs-store-soft: var(--room-line);

  /* keep the platform nav + shared components dark here */
  --playrs-bg: var(--room-bg);
  --playrs-frosted: rgba(10,10,10,.74);
  --playrs-frosted-fallback: rgba(10,10,10,.96);
  --playrs-text: var(--room-ink);
  --playrs-text-secondary: rgba(239,236,229,.78);
  --playrs-text-muted: var(--room-dim);
  --playrs-text-faint: var(--room-faint);
  --playrs-border: var(--room-line);
  --playrs-border-strong: var(--room-line-2);
  --playrs-hover: rgba(239,236,229,.08);

  background: var(--room-bg);
  color: var(--room-ink);
  -webkit-font-smoothing: antialiased;
}

body[data-store-scope="world"] .store-room {
  max-width: 1180px;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 24px calc(env(safe-area-inset-bottom, 0px) + 130px);
}

/* ---- top bar ---- */
body[data-store-scope="world"] .room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--room-line);
  font-size: 10px;
  letter-spacing: .16em;
}
body[data-store-scope="world"] .room-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--room-white); }
body[data-store-scope="world"] .room-brand img { width: 15px; height: auto; display: block; }
body[data-store-scope="world"] .room-top-links { display: flex; gap: 20px; color: var(--room-dim); }
body[data-store-scope="world"] .room-top-links a:hover,
body[data-store-scope="world"] .room-top-links a:focus-visible { color: var(--room-white); }

/* ---- hero ---- */
body[data-store-scope="world"] .room-hero { margin: 0; padding: 64px 0 46px; }
body[data-store-scope="world"] .room-hero .store-eyebrow { font-size: 10px; letter-spacing: .18em; color: var(--room-dim); margin: 0; }
body[data-store-scope="world"] .room-hero h1 {
  margin: 18px 0 0;
  font-size: clamp(48px, 11.5vw, 124px);
  line-height: .92;
  letter-spacing: -.02em;
  color: var(--room-white);
}
body[data-store-scope="world"] .room-hero > p:not(.store-eyebrow):not(.room-status) {
  margin: 22px 0 0;
  max-width: 44ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--room-dim);
}
body[data-store-scope="world"] .room-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--room-dim);
}
body[data-store-scope="world"] .room-dot { width: 6px; height: 6px; background: var(--room-white); display: inline-block; }
body[data-store-scope="world"] #inventory-available:not(:empty)::before { content: "//"; margin-right: 10px; color: var(--room-faint); }
body[data-store-scope="world"] #inventory-available { color: var(--room-white); font-weight: 700; }

/* ---- physical release (hats) ---- */
body[data-store-scope="world"] .store-room .playrs-purchase-v2 { margin: 0; padding: 34px 0 10px; border-top: 1px solid var(--room-line); }
body[data-store-scope="world"] .playrs-purchase-v2-header { border-bottom-color: var(--room-line); }
body[data-store-scope="world"] .playrs-purchase-v2-kicker { color: var(--room-dim); }
body[data-store-scope="world"] .playrs-purchase-v2-title {
  font-weight: 700;
  font-size: clamp(28px, 5.2vw, 54px);
  line-height: 1.02;
  letter-spacing: .005em;
  color: var(--room-white);
}
body[data-store-scope="world"] .playrs-purchase-v2-stock {
  padding: 6px 10px;
  border: 1px solid var(--room-line-2);
  color: var(--room-ink);
  font-weight: 700;
}
body[data-store-scope="world"] .playrs-purchase-v2-description { color: var(--room-dim); }
body[data-store-scope="world"] .playrs-purchase-v2-section-head { border-bottom-color: var(--room-line); }
body[data-store-scope="world"] .playrs-purchase-v2-section-title { font-weight: 700; color: var(--room-white); letter-spacing: .2em; }
body[data-store-scope="world"] .playrs-purchase-v2-section-note { color: var(--room-faint); }

body[data-store-scope="world"] .playrs-hat-grid-v2 { border-color: var(--room-line); }
body[data-store-scope="world"] .playrs-hat-unit-v2 {
  background: transparent;
  color: var(--room-ink);
  border-color: var(--room-line);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
body[data-store-scope="world"] .playrs-hat-unit-v2:hover:not([disabled]),
body[data-store-scope="world"] .playrs-hat-unit-v2:focus-visible:not([disabled]) {
  background: var(--room-hover);
  border-color: var(--room-line-2);
}
body[data-store-scope="world"] .playrs-hat-unit-v2[data-selected="true"] {
  background: var(--room-ink);
  color: var(--room-bg);
  border-color: var(--room-ink);
}
/* selected must beat hover/focus (they're more specific) */
body[data-store-scope="world"] .playrs-hat-unit-v2[data-selected="true"]:hover:not([disabled]),
body[data-store-scope="world"] .playrs-hat-unit-v2[data-selected="true"]:focus-visible:not([disabled]) {
  background: var(--room-ink);
  color: var(--room-bg);
  border-color: var(--room-ink);
}
body[data-store-scope="world"] .playrs-hat-unit-v2[data-selected="true"] .playrs-hat-unit-state { color: var(--room-on-ink-dim); }
body[data-store-scope="world"] .playrs-hat-unit-number { font-weight: 700; }
body[data-store-scope="world"] .playrs-hat-unit-state { color: var(--room-faint); }

body[data-store-scope="world"] .playrs-purchase-v2-checkout-head { color: var(--room-white); font-weight: 700; border-bottom-color: var(--room-line); }
body[data-store-scope="world"] .playrs-purchase-v2-row { border-bottom-color: var(--room-line); }
body[data-store-scope="world"] .playrs-purchase-v2-row span:first-child { color: var(--room-faint); }
body[data-store-scope="world"] .playrs-purchase-v2-action {
  background: var(--room-white);
  color: var(--room-bg);
  border: 1px solid var(--room-white);
  font-weight: 700;
}
body[data-store-scope="world"] .playrs-purchase-v2-action:hover:not([disabled]) { background: var(--room-ink); border-color: var(--room-ink); color: var(--room-bg); }
body[data-store-scope="world"] .playrs-purchase-v2-action[disabled] { background: transparent; color: var(--room-faint); border-color: var(--room-line-2); }
body[data-store-scope="world"] .playrs-purchase-v2-message,
body[data-store-scope="world"] .playrs-purchase-v2-meta { color: var(--room-faint); }

/* ---- digital releases ---- */
body[data-store-scope="world"] #digital-catalog { margin-top: 26px; }
body[data-store-scope="world"] #digital-catalog .playrs-purchase-v2-section-head {
  margin: 0 0 22px;
  padding: 30px 0 14px;
  border-top: 1px solid var(--room-line);
}
body[data-store-scope="world"] .room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 30px 22px;
  margin-bottom: 36px;
}
body[data-store-scope="world"] .room-card { display: flex; flex-direction: column; gap: 16px; }
body[data-store-scope="world"] .room-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--room-panel);
  border: 1px solid var(--room-line);
  overflow: hidden;
}
body[data-store-scope="world"] .room-tile-img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1); transition: filter 320ms ease; }
body[data-store-scope="world"] .room-card:hover .room-tile-img { filter: grayscale(0); }
body[data-store-scope="world"] .room-tile-glyph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--room-ink); }
body[data-store-scope="world"] .room-cube { width: 40%; height: auto; transition: transform 500ms cubic-bezier(.16,1,.3,1); }
body[data-store-scope="world"] .room-card:hover .room-cube { transform: rotate(-8deg) scale(1.04); }
body[data-store-scope="world"] .room-card-body { display: grid; gap: 8px; }
body[data-store-scope="world"] .room-card-body .store-eyebrow { margin: 0; font-size: 9px; letter-spacing: .16em; color: var(--room-dim); }
body[data-store-scope="world"] .room-card-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .05em; line-height: 1.25; color: var(--room-white); }
body[data-store-scope="world"] .room-card-desc { margin: 0; font-size: 12px; line-height: 1.6; color: var(--room-dim); }
body[data-store-scope="world"] .room-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--room-line);
}
body[data-store-scope="world"] .room-price { font-size: 14px; font-weight: 700; color: var(--room-white); }
body[data-store-scope="world"] .room-owned { font-size: 10px; letter-spacing: .16em; font-weight: 700; color: var(--room-ink); }
body[data-store-scope="world"] .room-card-foot .release-link {
  padding: 10px 14px;
  background: var(--room-white);
  color: var(--room-bg);
  border: 1px solid var(--room-white);
  font-size: 10px;
  letter-spacing: .16em;
  line-height: 1;
  font-weight: 700;
  transition: background 150ms ease, color 150ms ease;
}
body[data-store-scope="world"] .room-card-foot .release-link:hover,
body[data-store-scope="world"] .room-card-foot .release-link:focus-visible { background: var(--room-ink); border-color: var(--room-ink); }
body[data-store-scope="world"] .room-card-foot .release-link[disabled] { background: transparent; color: var(--room-dim); border-color: var(--room-line-2); }
body[data-store-scope="world"] .store-empty { color: var(--room-faint); font-size: 11px; letter-spacing: .14em; }

/* footer link row */
body[data-store-scope="world"] footer.store-links { border-top: 1px solid var(--room-line); padding-top: 18px; color: var(--room-dim); font-size: 10px; letter-spacing: .16em; }

@media (max-width: 760px) {
  body[data-store-scope="world"] .store-room { padding-left: 16px; padding-right: 16px; }
  body[data-store-scope="world"] .room-hero { padding: 44px 0 34px; }
  body[data-store-scope="world"] .room-grid { grid-template-columns: 1fr 1fr; gap: 24px 14px; }
  body[data-store-scope="world"] .room-card-title { font-size: 14px; }
  body[data-store-scope="world"] .room-card-foot { flex-direction: column; align-items: stretch; }
  body[data-store-scope="world"] .room-card-foot .release-link { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-store-scope="world"] .room-cube,
  body[data-store-scope="world"] .room-tile-img { transition: none; }
}

/* PLAYRS-THEME-INVERT-V1: light theme = the room inverted
   (off-white field, black ink, black filled actions) */
html[data-playrs-theme="light"] body[data-store-scope="world"] {
  --room-bg: #efece5;
  --room-panel: #e6e2d9;
  --room-ink: #151513;
  --room-white: #000000;
  --room-dim: rgba(21,21,19,.62);
  --room-faint: rgba(21,21,19,.4);
  --room-line: rgba(21,21,19,.12);
  --room-line-2: rgba(21,21,19,.26);
  --room-hover: rgba(21,21,19,.05);
  --room-on-ink-dim: rgba(239,236,229,.62);

  --playrs-bg: #efece5;
  --playrs-frosted: rgba(239,236,229,.74);
  --playrs-frosted-fallback: rgba(239,236,229,.97);
  --playrs-text: #151513;
  --playrs-text-secondary: rgba(21,21,19,.76);
  --playrs-text-muted: rgba(21,21,19,.58);
  --playrs-text-faint: rgba(21,21,19,.42);
  --playrs-border: rgba(21,21,19,.18);
  --playrs-border-strong: rgba(21,21,19,.34);
  --playrs-hover: rgba(21,21,19,.08);
}
html[data-playrs-theme="light"] body[data-store-scope="world"] .room-brand img { filter: invert(1); }
