/*
  PLAYRS-HUB-V1 -- owned by js/playrs-hub-v1.js. Community hub at /inventory/.
  Palette: black / white / red (red = signal only: live, new, active, CTA).
  Hairlines, negative space, no rounded cards, no shadows, no gradients.
*/
:root {
  --phub-bg: #070707;
  --phub-panel: #0e0e0e;
  --phub-ink: #f4f2ee;
  --phub-dim: rgba(244,242,238,.62);
  --phub-faint: rgba(244,242,238,.38);
  --phub-line: rgba(244,242,238,.12);
  --phub-line-2: rgba(244,242,238,.24);
  --phub-red: #e3261c;
}
html, body { margin: 0; background: var(--phub-bg); color: var(--phub-ink); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
* { box-sizing: border-box; }

.phub-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 24px calc(env(safe-area-inset-bottom, 0px) + 130px);
}
.phub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--phub-line);
  font-size: 10px;
  letter-spacing: .16em;
}
.phub-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.phub-brand img { width: 15px; height: auto; display: block; }
.phub-top-links { display: flex; gap: 18px; color: var(--phub-dim); }
.phub-top-links a:hover, .phub-top-links a:focus-visible { color: var(--phub-ink); }

.phub-label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--phub-dim);
}
.phub-dot { width: 6px; height: 6px; background: var(--phub-red); display: inline-block; flex: none; }

.phub-hero { padding: 64px 0 44px; }
.phub-title {
  margin: 18px 0 0;
  font-size: clamp(54px, 13vw, 132px);
  line-height: .92;
  letter-spacing: -.02em;
}
.phub-lede { margin: 22px 0 0; max-width: 46ch; font-size: 14px; line-height: 1.6; color: var(--phub-dim); }
.phub-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 28px 0 0; font-size: 10px; letter-spacing: .16em; color: var(--phub-faint); }
.phub-stats b { color: var(--phub-ink); font-size: 13px; margin-right: 6px; }

.phub-section { padding: 30px 0; border-top: 1px solid var(--phub-line); }
.phub-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.phub-h { margin: 0; font-size: 12px; letter-spacing: .2em; }

/* featured */
.phub-feature { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 34px; align-items: center; }
.phub-feature-title { margin: 14px 0 0; font-size: clamp(30px, 6vw, 56px); line-height: 1.02; letter-spacing: .01em; }
.phub-desc { margin: 14px 0 0; font-size: 13px; line-height: 1.65; color: var(--phub-dim); max-width: 52ch; }
.phub-feature .phub-meta { margin-top: 16px; }
.phub-feature .phub-card-foot { margin-top: 26px; }

/* tiles */
.phub-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--phub-panel);
  border: 1px solid var(--phub-line);
  overflow: hidden;
}
.phub-tile-img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1); transition: filter 300ms ease; }
.phub-card:hover .phub-tile-img, .phub-feature:hover .phub-tile-img { filter: grayscale(0); }
.phub-tile-glyph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--phub-ink); }
.phub-cube { width: 42%; height: auto; transition: transform 500ms cubic-bezier(.16,1,.3,1); }
.phub-card:hover .phub-cube, .phub-feature:hover .phub-cube { transform: rotate(-8deg) scale(1.04); }
.phub-tile-type { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; }
.phub-tile-num { font-size: clamp(64px, 12vw, 120px); font-weight: 700; line-height: .9; }
.phub-tile-of { margin-top: 8px; font-size: 10px; letter-spacing: .16em; color: var(--phub-dim); }
.phub-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.phub-badge { padding: 4px 7px; font-size: 9px; font-weight: 700; letter-spacing: .14em; background: var(--phub-bg); border: 1px solid var(--phub-line-2); }
.phub-badge--new { background: var(--phub-red); border-color: var(--phub-red); color: #fff; }
.phub-badge--live { border-color: var(--phub-red); color: var(--phub-ink); }
.phub-badge--live::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px; background: var(--phub-red); vertical-align: 1px; }

/* tabs */
.phub-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.phub-tab {
  padding: 7px 12px;
  background: transparent;
  color: var(--phub-dim);
  border: 1px solid transparent;
  border-radius: 0;
  font: inherit;
  font-size: 10px;
  letter-spacing: .16em;
  cursor: pointer;
}
.phub-tab:hover { color: var(--phub-ink); }
.phub-tab[aria-selected="true"] { color: var(--phub-ink); border-color: var(--phub-line-2); box-shadow: inset 0 -2px 0 var(--phub-red); font-weight: 700; }
.phub-tab:focus-visible { outline: 1px solid var(--phub-ink); outline-offset: 2px; }

/* grid + cards */
.phub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px 22px; }
.phub-card { display: flex; flex-direction: column; gap: 14px; }
.phub-card[hidden] { display: none; }
.phub-card-body { display: grid; gap: 8px; }
.phub-card-title { margin: 0; font-size: 16px; letter-spacing: .06em; line-height: 1.3; }
.phub-meta { margin: 0; font-size: 10px; letter-spacing: .12em; color: var(--phub-faint); }
.phub-card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--phub-line); font-size: 10px; letter-spacing: .14em; }
.phub-price { font-weight: 700; font-size: 13px; color: var(--phub-ink); }
.phub-go { color: var(--phub-dim); transition: color 150ms ease; }
.phub-card:hover .phub-go, .phub-card:focus-visible .phub-go { color: var(--phub-red); }
.phub-card:focus-visible, .phub-feature:focus-visible { outline: 1px solid var(--phub-ink); outline-offset: 6px; }

.phub-cta {
  display: inline-block;
  padding: 11px 16px;
  background: var(--phub-ink);
  color: var(--phub-bg);
  border: 1px solid var(--phub-ink);
  border-radius: 0;
  font: inherit;
  font-size: 10px;
  letter-spacing: .16em;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.phub-cta:hover, .phub-feature:hover .phub-cta { background: var(--phub-red); border-color: var(--phub-red); color: #fff; }
.phub-cta[disabled] { opacity: .5; cursor: default; }

/* updates + creators */
.phub-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 40px; }
.phub-feed { list-style: none; margin: 0; padding: 0; }
.phub-feed-item { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--phub-line); font-size: 11px; letter-spacing: .08em; align-items: baseline; }
.phub-feed-item:first-child { padding-top: 0; }
.phub-feed-type { font-size: 9px; letter-spacing: .16em; color: var(--phub-red); font-weight: 700; }
.phub-feed-text a:hover { text-decoration: underline; text-underline-offset: 3px; }
.phub-feed-date { font-size: 9px; letter-spacing: .14em; color: var(--phub-faint); white-space: nowrap; }
.phub-creators { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.phub-creator { display: grid; gap: 6px; padding: 13px 0; border-bottom: 1px solid var(--phub-line); }
.phub-creator:first-child { padding-top: 0; }
.phub-creator-name { font-size: 15px; font-weight: 700; letter-spacing: .1em; }

/* join */
.phub-join { padding-bottom: 10px; }
.phub-form { display: flex; gap: 10px; margin-top: 20px; max-width: 520px; }
.phub-form input[type="email"] {
  flex: 1; min-width: 0;
  padding: 11px 0;
  background: transparent;
  color: var(--phub-ink);
  border: 0; border-bottom: 1px solid var(--phub-line-2);
  border-radius: 0;
  font: inherit; font-size: 12px; letter-spacing: .06em;
  outline: none;
}
.phub-form input[type="email"]:focus { border-bottom-color: var(--phub-ink); }
.phub-form input::placeholder { color: var(--phub-faint); }
.phub-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.phub-form-status { min-height: 1.4em; margin: 12px 0 0; font-size: 10px; letter-spacing: .14em; color: var(--phub-dim); }

.phub-empty { margin: 0; font-size: 11px; letter-spacing: .14em; color: var(--phub-faint); }
.phub-loading { padding: 80px 0; }

@media (max-width: 760px) {
  .phub-shell { padding-left: 16px; padding-right: 16px; }
  .phub-hero { padding: 44px 0 34px; }
  .phub-feature { grid-template-columns: 1fr; gap: 22px; }
  .phub-split { grid-template-columns: 1fr; }
  .phub-grid { grid-template-columns: 1fr 1fr; gap: 22px 14px; }
  .phub-card-title { font-size: 13px; }
  .phub-card-foot { flex-direction: column; gap: 6px; }
  .phub-feed-item { grid-template-columns: 1fr auto; }
  .phub-feed-type { grid-column: 1 / -1; }
  .phub-top-links { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .phub-cube, .phub-tile-img { transition: none; }
}

/* dark theme: pin the shared theme tokens so the platform nav and any
   shared component match the hub (light theme uses the light block below) */
html:not([data-playrs-theme="light"]) body[data-store-scope="platform"] {
  --playrs-bg: #070707;
  --playrs-surface: #0e0e0e;
  --playrs-frosted: rgba(7,7,7,.72);
  --playrs-frosted-fallback: rgba(7,7,7,.96);
  --playrs-text: #f4f2ee;
  --playrs-text-secondary: rgba(244,242,238,.78);
  --playrs-text-muted: rgba(244,242,238,.58);
  --playrs-text-faint: rgba(244,242,238,.42);
  --playrs-border: rgba(244,242,238,.14);
  --playrs-border-strong: rgba(244,242,238,.28);
  --playrs-focus: rgba(244,242,238,.6);
  --playrs-hover: rgba(244,242,238,.09);
}
@media (max-width: 760px) {
  .phub-tile--feature { aspect-ratio: 4 / 3; }
}

/* creator posts (PLAYRS-COMMUNITY-V1) */
.phub-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px 22px; }
.phub-post { display: grid; gap: 10px; align-content: start; scroll-margin-top: 24px; }
.phub-post:target { outline: 1px solid var(--phub-red); outline-offset: 8px; }
.phub-post-img { aspect-ratio: 4 / 3; background: var(--phub-panel); border: 1px solid var(--phub-line); overflow: hidden; }
.phub-post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phub-post-body { margin: 0; font-size: 12px; line-height: 1.7; color: var(--phub-dim); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.phub-post-body--open { display: block; -webkit-line-clamp: unset; }
.phub-post-more { justify-self: start; padding: 0; background: none; border: 0; color: var(--phub-ink); font: inherit; font-size: 10px; letter-spacing: .16em; cursor: pointer; }
.phub-post-more:hover { color: var(--phub-red); }
.phub-domain { color: var(--phub-dim); } .phub-domain:hover { color: var(--phub-ink); text-decoration: underline; text-underline-offset: 3px; }

/* PLAYRS-THEME-INVERT-V1: light theme = the hub inverted (red stays signal) */
html[data-playrs-theme="light"] {
  --phub-bg: #f3f1ec;
  --phub-panel: #e9e6df;
  --phub-ink: #0b0b0b;
  --phub-dim: rgba(11,11,11,.64);
  --phub-faint: rgba(11,11,11,.42);
  --phub-line: rgba(11,11,11,.12);
  --phub-line-2: rgba(11,11,11,.26);
  --phub-red: #d01f16;
}
html[data-playrs-theme="light"] .phub-brand img { filter: invert(1); }

/* ENGINES (PLAYRS-HUB-ENGINES-V1): how a world is rendered */
.phub-head-note { font-size: 10px; letter-spacing: .16em; color: var(--phub-faint); }
.phub-engines-lede { margin: -8px 0 26px; }
.phub-engines { display: grid; gap: 28px; }
.phub-engine {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--phub-line);
  background: var(--phub-panel);
  transition: border-color 160ms ease;
}
a.phub-engine:hover, a.phub-engine:focus-visible { border-color: var(--phub-line-2); }
a.phub-engine:hover .phub-cta { background: var(--phub-red); border-color: var(--phub-red); color: #fff; }
.phub-engine-states { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.phub-state { margin: 0; display: grid; gap: 8px; }
.phub-state svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; border: 1px solid var(--phub-line); }
.phub-state figcaption { display: grid; gap: 3px; font-size: 8px; letter-spacing: .12em; line-height: 1.4; }
.phub-state figcaption b { color: var(--phub-ink); font-weight: 700; }
.phub-state figcaption span { color: var(--phub-faint); }
.phub-engine-body { display: grid; gap: 12px; align-content: start; }
.phub-badges--inline { position: static; flex-wrap: wrap; }
.phub-engine-title { margin: 4px 0 0; font-size: clamp(26px, 4.4vw, 44px); }
.phub-components { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.phub-components li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--phub-line); font-size: 11px; line-height: 1.5; }
.phub-comp-type { font-size: 9px; font-weight: 700; letter-spacing: .16em; color: var(--phub-ink); }
.phub-comp-type::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 7px; background: var(--phub-red); vertical-align: 1px; }
.phub-comp-detail { color: var(--phub-dim); }
.phub-engine-price { display: inline-flex; align-items: baseline; gap: 10px; }
.phub-price-was { font-size: 11px; color: var(--phub-faint); text-decoration: line-through; }
@media (max-width: 760px) {
  .phub-engine { grid-template-columns: 1fr; gap: 22px; padding: 16px; }
  .phub-state figcaption { font-size: 7px; letter-spacing: .08em; }
  .phub-components li { grid-template-columns: 1fr; gap: 4px; }
}
