/* /show/:slug on the X stage (DoubloonWeb.Projects.ShowX). J's tokens and
   type; the X pieces (screen, pill tabs, welded bar, title strip, credits
   panel) come from project_x.css inside .px-root.px-jc islands, the tiles
   from shows_j.css. Desktop: the credits panel beside the screen. Phones:
   a credits bar pinned to the bottom of the screen in its place. */

.ssx {
  --s-bg: #07070f;
  --s-surface: #0f0f1e;
  --s-surface-2: #17172c;
  --s-line: rgba(242, 237, 228, 0.13);
  --s-line-2: rgba(242, 237, 228, 0.26);
  --s-text: #f2ede4;
  --s-gold: #f5c518;
  --s-ink: #1a1300;
  --s-green: #21e458;
  --s-red: #ff5a4f;

  background: var(--s-bg);
  color: var(--s-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 16px 16px 56px;
  /* Its own stacking layer, under the site header: the screen's pill tabs
     (z-index 20 in project_x.css) and the credits bar stay beneath the
     header's menu (also z-20) instead of drawing over it. */
  isolation: isolate;
}
.ssx :where(*, *::before, *::after) { box-sizing: border-box; }
.ssx [x-cloak] { display: none !important; }
.ssx :where(ul, ol) { list-style: none; margin: 0; padding: 0; }

/* X islands: project_x.css styles their insides; the page owns the box. */
.ssx .px-root.ssx-px { min-height: 0; background: transparent; }
/* The Verified tooltip only takes up room while it's open: hidden, its 262px
   box still widened the phone page. */
.ssx .px-root .px-vb:not(:focus-within) .px-vb-tip { display: none; }

/* ── The screen's panes (Info, Backers, Artist, LOOR) ── */
/* No scrollbar inside the screen, and text scrolled up fades out before it
   reaches the pill tabs. */
.ssx .px-root .px-info-scroll,
.ssx .px-root .px-roll { scrollbar-width: none; }
.ssx .px-root .px-info-scroll::-webkit-scrollbar,
.ssx .px-root .px-roll::-webkit-scrollbar { display: none; }
.ssx .px-root .px-info-scroll {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 52px, #000 76px);
  mask-image: linear-gradient(to bottom, transparent 0, transparent 52px, #000 76px);
}

/* ── Back from the membership's checkout: the trial's end ── */
.ssx-joined {
  max-width: 1280px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--s-surface);
  box-shadow: inset 0 0 0 1px rgba(33, 228, 88, 0.45);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}
.ssx-joined .is-wait { color: rgba(242, 237, 228, 0.75); }
.ssx-joined a { color: var(--s-gold); text-decoration: underline; text-underline-offset: 2px; }

/* ── Stage: screen | credits, then the shelf ── */
.ssx-stage {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ssx-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

@media (min-width: 1024px) {
  .ssx { padding: 24px 32px 64px; }
  .ssx-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas: "main side" "below below";
    gap: 26px;
    align-items: stretch;
  }
  .ssx-main { grid-area: main; }
  .ssx-side { grid-area: side; display: flex; flex-direction: column; }
  .ssx .ssx-side .px-credits { flex: 1 1 auto; }
  .ssx-shelf { grid-area: below; }
  /* No credits (a show not crowdfunded on LOOR): the screen takes the
     row, at about the size it has beside the credits. */
  .ssx-nocredits .ssx-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "below";
  }
  .ssx-nocredits .ssx-main { width: 100%; max-width: 934px; justify-self: center; }
}

/* ── Actions: J's buttons, and full-width blocks above them ── */
.ssx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
.ssx-actions-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ssx-actions-btns > .ssx-fund,
.ssx-actions-btns > .ssx-closed,
.ssx-actions-btns > .tjp { flex: 1 1 100%; }
.ssx .ssx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ssx .ssx-btn:active { transform: translateY(1px); }
.ssx .ssx-btn-gold { background: var(--s-gold); color: var(--s-ink); }
.ssx .ssx-btn-gold:hover { background: #f8d44f; }
.ssx .ssx-btn-line { box-shadow: inset 0 0 0 2px var(--s-text); color: var(--s-text); }
.ssx .ssx-btn-line:hover { box-shadow: inset 0 0 0 2px var(--s-gold); }
.ssx .ssx-btn .px-loot-mark { width: 0.72em; height: 0.92em; }
.ssx .ssx-play-i { width: 18px; height: 18px; margin-left: -4px; }
/* "Free with an account" by a signed-out viewer's Watch (sign-up first). */
.ssx .ssx-note { font-size: 14px; font-weight: 600; color: rgba(242, 237, 228, 0.7); text-wrap: balance; }
.ssx .ssx-cap-act { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* A shelf caption's action with no note under it: no box of its own. */
.ssx .ssx-cap-do { display: contents; }
.ssx-closed {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--s-surface);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 79, 0.4);
  font-size: 15px;
  line-height: 1.45;
}
.ssx-closed-t { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--s-red); }
@media (max-width: 599px) {
  .ssx-actions-btns { width: 100%; }
  .ssx-actions-btns .ssx-btn { flex: 1 1 100%; }
  .ssx-actions-btns .ssx-note { flex: 1 1 100%; text-align: center; }
}

/* ── Thumbs, the play glyph, states ── */
.ssx .ssx-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 38px;
  height: 38px;
  padding: 9px 8px 9px 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(7, 7, 15, 0.7);
  box-shadow: inset 0 0 0 1.5px rgba(242, 237, 228, 0.7);
  color: var(--s-text);
  transition: background 0.15s, color 0.15s;
}
.ssx a:hover .ssx-play { background: var(--s-gold); color: var(--s-ink); box-shadow: none; }
.ssx .ssx-lock-i { width: 14px; height: 14px; flex: none; }
.ssx .is-pct { color: var(--s-green); font-weight: 800; }

/* ── The shelf: J's tiles, one row, one caption ── */
.ssx .ssx-shelf { background: transparent; font-size: 16px; min-width: 0; }
.ssx .ssx-states { margin-bottom: 16px; }
.ssx .ssx-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 44%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 4px 6px;
  margin: -4px -4px 0;
}
.ssx .ssx-row::-webkit-scrollbar { display: none; }
.ssx .ssx-cell { scroll-snap-align: start; min-width: 0; }
@media (min-width: 640px) { .ssx .ssx-row { grid-auto-columns: 240px; gap: 18px; } }
@media (min-width: 1024px) { .ssx .ssx-row { grid-auto-columns: 272px; } }
.ssx .ssx-tile { width: 100%; text-align: left; color: inherit; }
.ssx .ssx-tile .sj-vessel { transition: box-shadow 0.15s; }
.ssx .ssx-tile.is-picked .sj-vessel { box-shadow: 0 0 0 2px var(--s-bg), 0 0 0 4px var(--s-text); }
.ssx .ssx-tile .sj-name { font-weight: 700; }
.ssx .ssx-n { color: var(--s-gold); font-weight: 900; margin-right: 2px; }
.ssx .ssx-tile .sj-meta { display: inline-flex; align-items: center; gap: 6px; }
.ssx .ssx-tile.is-free .sj-meta { color: var(--s-green); }
.ssx .ssx-lock {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  display: inline-flex;
  padding: 6px;
  border-radius: 8px;
  background: rgba(7, 7, 15, 0.82);
}
.ssx .ssx-vessel-range .sj-art { filter: saturate(0.4) brightness(0.32); }
.ssx .ssx-range-n {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.ssx .ssx-cap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--s-line);
}
.ssx .ssx-cap-text { min-width: 0; max-width: 72ch; }
.ssx .ssx-cap-t { font-size: 20px; font-weight: 800; line-height: 1.3; }
.ssx .ssx-cap-n { color: var(--s-gold); font-weight: 900; margin-right: 4px; }
.ssx .ssx-cap-min { margin-left: 12px; font-size: 15px; font-weight: 600; }
.ssx .ssx-cap-s { margin-top: 6px; font-size: 16px; line-height: 1.5; }
@media (max-width: 639px) {
  .ssx .ssx-cap-s {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ssx .ssx-cap { flex-direction: column; align-items: stretch; }
  .ssx .ssx-cap .ssx-btn { width: 100%; }
}

/* ── The creator, beside the buttons ── */
.ssx .ssx-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ssx .ssx-chip-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.ssx .ssx-chip-name { font-size: 16px; font-weight: 800; white-space: nowrap; }
.ssx .ssx-chip-follow {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--s-line-2);
  font-size: 15px;
  font-weight: 700;
  color: var(--s-text);
  text-decoration: none;
}
.ssx .ssx-chip-follow:hover { box-shadow: inset 0 0 0 1.5px var(--s-gold); }

/* ── The live credits ── */
.ssx .ssx-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--s-text);
}
.ssx .ssx-live i,
.ssx .ssx-live-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--s-green);
  animation: ssx-live 2s ease-out infinite;
}
@keyframes ssx-live {
  0% { box-shadow: 0 0 0 0 rgba(33, 228, 88, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(33, 228, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(33, 228, 88, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ssx .ssx-live i,
  .ssx .ssx-live-dot { animation: none; }
}
.ssx .ssx-seat-role {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--s-gold);
}
.ssx .ssx-seat-name { font-size: 16px; font-weight: 800; color: var(--s-text); }
.ssx .ssx-seat-name.is-open { font-weight: 500; font-style: italic; }

/* ── Phones: the credits bar in place of the panel ──
   Pinned from page load; collapsed it shows the top seat's credit title over
   the full name, a tap opens every seat. */
.ssx .ssx-cbar-wrap { display: none; }

@media (max-width: 1023px) {
  .ssx { padding-bottom: 104px; }
  /* No credits bar pinned at the foot. */
  .ssx.ssx-nocredits { padding-bottom: 56px; }
  .ssx-side { display: none; }

  .ssx .ssx-cbar-wrap { display: block; }
  .ssx .ssx-cbar-scrim {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(7, 7, 15, 0.72);
  }
  .ssx .ssx-cbar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 40;
    background: var(--s-surface);
    border: 1px solid rgba(245, 197, 24, 0.45);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
  }
  .ssx .ssx-cbar.is-open { border-color: var(--s-gold); }
  .ssx .ssx-cbar-row { display: flex; align-items: center; min-height: 68px; padding: 10px 14px; }
  .ssx .ssx-cbar-seat {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  /* Title over the full name, centred like a credit roll: nothing cut off,
     a long name wraps. */
  .ssx .ssx-cbar-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 0;
    text-align: center;
  }
  .ssx .ssx-cbar .ssx-seat-role { font-size: 12px; }
  .ssx .ssx-cbar-who { min-width: 0; font-size: 18px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
  .ssx .ssx-cbar-who.is-open { font-weight: 500; font-style: italic; }
  .ssx .ssx-cbar-chev { flex: none; width: 20px; height: 20px; color: var(--s-gold); transition: transform 0.25s; }
  .ssx .ssx-cbar-chev.is-flip { transform: rotate(180deg); }

  .ssx .ssx-cbar-list {
    max-height: 62vh;
    overflow-y: auto;
    padding: 16px 16px 4px;
    border-bottom: 1px solid var(--s-line);
  }
  .ssx .ssx-crow {
    display: grid;
    grid-template-columns: 1.6em minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid rgba(242, 237, 228, 0.08);
  }
  .ssx .ssx-crow-n { font-size: 18px; font-weight: 900; color: var(--s-gold); font-variant-numeric: tabular-nums; }
  .ssx .ssx-crow-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .ssx .ssx-crow .ssx-seat-name { font-size: 18px; overflow-wrap: anywhere; }
  .ssx .ssx-crow.is-top .ssx-seat-name { color: var(--s-gold); font-size: 20px; font-weight: 900; }
  /* The viewer's Current rank under the seats, as the desktop panel's foot
     reads it: label left, rank + LOOT right, over a dashed rule. */
  .ssx .ssx-crank {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px dashed var(--s-line-2);
    white-space: nowrap;
  }
  .ssx .ssx-crank > :nth-child(2) { margin-left: auto; }
  /* What each holder has put in, as the desktop panel shows it. */
  .ssx .ssx-crow-amt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 800;
    color: var(--s-gold);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .ssx .ssx-crow-amt .px-loot-mark { width: 0.72em; height: 0.92em; }
}

/* ── Phones: the screen ── */
@media (max-width: 639px) {
  /* Info, Artist and LOOR get room to read, as Backers does on /x. */
  .ssx .px-root .trailer-wrap:has(> .px-info:not([x-cloak]):not([style*="none"])) {
    aspect-ratio: auto;
    height: 360px;
  }
  .ssx .px-root .px-info-scroll { padding-top: 60px; }
  .ssx .px-root .px-info-scroll {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 40px, #000 58px);
    mask-image: linear-gradient(to bottom, transparent 0, transparent 40px, #000 58px);
  }
}
/* The five pill tabs fit on one row down to a 320px phone. */
@media (max-width: 480px) {
  .ssx .px-root .trailer-tab { padding: 8px 6px; }
}
@media (max-width: 374px) {
  .ssx { padding-left: 12px; padding-right: 12px; }
  /* J's tab strip bleeds by --gut to the page edge: match the narrower edge. */
  .ssx .ssx-shelf.sj-root { --gut: 12px; }
  .ssx .px-root .trailer-tab { font-size: 11px; padding: 7px 5px; }
}
/* The welded bar's percent and totals share a phone's width (on /x they
   overlap there). */
@media (max-width: 479px) {
  .ssx .px-root .px-hbar-label,
  .ssx .px-root .px-hbar-pct { font-size: 14px; }
  .ssx .px-root .px-hbar-label { right: 12px; }
  .ssx .px-root .px-hbar-pct { left: 12px; }
}
@media (max-width: 400px) {
  .ssx .px-root .px-hbar-label,
  .ssx .px-root .px-hbar-pct { font-size: 13px; }
}
@media (max-width: 359px) {
  .ssx .px-root .px-hbar-goal { display: none; }
}

/* Produce this opens the /shows fund sheet over the page (loot_sheet.css):
   the phone credits bar steps aside while it's open. */
html.sjf-lock .ssx-cbar-wrap { display: none; }

/* /watch/:slug/episode/:id when the player won't play it (WatchController,
   still a 404): the membership offer, or "Still in production". */
.ssx.ssx-locked { min-height: 62vh; display: flex; align-items: center; justify-content: center; padding: 48px 16px 64px; }
.ssx .ssx-locked-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ssx .ssx-locked-h { margin: 0; font-size: clamp(28px, 7vw, 40px); font-weight: 900; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.ssx .ssx-locked-card .ssx-note { margin: 0; font-size: 16px; }
.ssx .ssx-locked-btns { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 16px; }
.ssx .ssx-locked-btns .ssx-btn { width: 100%; max-width: 320px; white-space: normal; text-align: center; }
.ssx .ssx-locked-back { color: var(--s-text); font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ssx .ssx-locked-back:hover { color: var(--s-gold); }

/* A members-only tile's tap: the membership offer over the page, in the
   locked episode page's words (ShowX.offer/1). Above the phone credits bar
   (z-index 40), so nothing of it sits behind the bar. */
/* Open, the page rises over the site header (z-10), as the fund sheet's
   html.sjf-lock does, so the scrim covers the header too and the header
   never sits on the offer (a phone held sideways). */
html.ssx-offer-lock .ssx { position: relative; z-index: 20; }
.ssx .ssx-offer-scrim { position: fixed; inset: 0; z-index: 41; background: rgba(7, 7, 15, 0.78); }
.ssx .ssx-offer-box {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 42;
  width: calc(100% - 32px);
  max-width: 400px;
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 24px 20px;
  text-align: center;
  background: var(--s-surface);
  border: 1px solid rgba(245, 197, 24, 0.45);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.ssx .ssx-offer-box:focus { outline: none; }
.ssx .ssx-offer-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.ssx .ssx-offer-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ssx .ssx-offer-ep {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 15px;
  font-weight: 700;
  color: rgba(242, 237, 228, 0.7);
}
.ssx .ssx-offer-ep .ssx-cap-n { margin-right: 0; }
.ssx .ssx-offer-ep span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssx .ssx-offer-h { margin: 0; font-size: 28px; font-weight: 900; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.ssx .ssx-offer-box .ssx-note { margin: 0; font-size: 16px; }
.ssx .ssx-offer-box .ssx-btn { width: 100%; margin-top: 8px; }
.ssx .ssx-offer-no { min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 700; color: var(--s-text); text-decoration: underline; text-underline-offset: 3px; }
.ssx .ssx-offer-no:hover { color: var(--s-gold); }
