/* card-chrome.css — THE canonical chrome shared by every Unbanned Reality CARD (D31).
 *
 * A Card is ONE shared product, not a per-app copy — so the parts every card wears
 * identically live HERE and are SYNCED in (D23: canonical file in assets/brand/,
 * consumers copy it via their own scripts/sync-card-chrome.mjs on predev/prebuild).
 * Never hand-copy these rules into a card; add to this file instead.
 *
 * Consumers today: reality-details/ (Reality Card) · experience-card/ (Experience Card).
 *
 * What lives here = what is genuinely IDENTICAL across cards:
 *   .uc-close      the close control (immersive's panel X: 40x20 pill, flat #161616,
 *                  no border, 16px chrome-close glyph, RED fill on hover/active)
 *   .uc-sep        the ruled section label (line · LABEL · line), 11px .18em caps
 *   .detail-dialog the dialog anatomy (native <dialog>, glass panel + sheens, ruled
 *                  header, scrolling content, footer, --dialog-pad token, .dialog-x)
 *   .about-*       the About content (docs panel, tab chips, text block) — driven by
 *                  card-chrome.mjs renderAboutDocs()/bindAboutTabs()
 *   .field / dt/dd the detail-row anatomy (label column left, value right, divider)
 *                  + .detail-preview (the clickable row: standing underline + chevron)
 *
 * What does NOT belong here: anything a card owns alone (its stage, its image
 * lightbox, its link rows — and the capsule, its own canonical pair capsule.mjs/css).
 */

/* ── the close control ─────────────────────────────────────────────────────────── */
.uc-close {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background-color: #161616;
  color: #e5e5e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* the glyph is pinned to 16px here — an icon component's own size prop must not win */
.uc-close > svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
  color: #e5e5e5;
}

/* hover FILLS the pill red and keeps the glyph light — never a red glyph on dark.
   Gated to real pointers so a touch tap can never leave it stuck red. */
@media (hover: hover) and (pointer: fine) {
  .uc-close:hover {
    background-color: #ff3838;
    color: #e5e5e5;
  }
}

.uc-close:active {
  background-color: #ff3838;
  color: #e5e5e5;
}

.uc-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 255, 56, .7);
}

/* ── the ruled section label ───────────────────────────────────────────────────── */
.uc-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
}

.uc-sep .uc-sep-line {
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, .14);
}

.uc-sep .uc-sep-label {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent, #38ff38);
  text-shadow: 0 0 12px rgba(var(--accent-rgb, 56, 255, 56), .4);
}


/* ── the DIALOG anatomy ────────────────────────────────────────────────────────────
 * Every Card opens the same dialog: a native <dialog> holding a glass panel with a
 * ruled header, a scrolling content area and the platform footer. It was defined only
 * inside the Reality Card; it now lives here so the Experience Card's About is the
 * SAME dialog rather than a lookalike. Card-specific variants (the Reality Card's
 * image lightbox, its About tabs, its link rows) stay in that card.
 * ---------------------------------------------------------------------------------- */
.detail-dialog {
  width: min(34rem, calc(100% - 16px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
  color: #e5e5e5;
  outline: 0;
}

.detail-dialog::backdrop {
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-panel {
  /* ONE padding token: the X is placed from it, so the close control can never drift
     out of line with the content no matter what a card sets. */
  --dialog-pad: 12px;
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 16px;
  padding: var(--dialog-pad);
  background: linear-gradient(180deg,rgba(255,255,255,.042) 0%,rgba(26,31,27,.90) 18%,rgba(16,20,17,.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), inset 0 -1px 0 rgba(0,0,0,.38), 0 18px 54px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dialog-liquid-sheen,
.dialog-liquid-hairline {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 16px;
}

.dialog-liquid-sheen {
  inset: 0;
  background: radial-gradient(80% 54% at 18% 0%,rgba(255,255,255,.11),transparent 58%), radial-gradient(54% 42% at 92% 18%,rgba(255,255,255,.06),transparent 62%);
}

.dialog-liquid-hairline {
  inset: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 0 0 1px rgba(255,255,255,.035);
}

.dialog-inner {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 0;
  max-height: calc(100dvh - 56px);
  flex-direction: column;
}

.dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.dialog-header > span {
  height: 1px;
  flex: 1;
  background: rgba(255,255,255,.14);
}

.dialog-header h2 {
  margin: 0;
  color: #38ff38;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.dialog-content {
  min-height: 0;
  max-height: calc(100dvh - 164px);
  overflow: auto;
  margin-top: 14px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(56,255,56,.35) transparent;
}

.info-section {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: var(--dialog-pad);
  background: #101312;
}

/* the close X is TUCKED INTO the panel's CORNER — not seated on the content line, which
   is what made it read as floating beside the header. 8px is the family's corner number:
   immersive's arcs panel X sits on that panel's 0.5rem padding (arcs-panel.css), and its
   inventory popup — a card with this exact anatomy (1px border, 16px radius, 12/20px
   padding) — pins its X inline to top/right 0.5rem, "to the card's OWN top-right corner".
   FIXED on purpose, NOT --dialog-pad: the padding steps 12→20 at 400px, and a corner must
   not move with it. Placement lives here, never re-typed per card. */
.dialog-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
}

/* the roomier padding every Card uses above the narrow breakpoint (was only in the
   Reality Card, which is exactly why the two cards' dialogs disagreed) */
@media (min-width: 400px) {
  .dialog-panel { --dialog-pad: 20px; }
}

.dialog-footer {
  flex: 0 0 auto;
  margin-top: 20px;
  padding-bottom: 4px;
  color: rgba(255,255,255,.45);
  font-size: 12px;
  text-align: center;
}


/* ── the ABOUT content anatomy ─────────────────────────────────────────────────────
 * The About dialog's CONTENT is the same in every Card: the lighter .about-docs glass
 * panel holding the tab chips and the dark text block with the green section label.
 * (It was only in the Reality Card, so the Experience Card's About looked like a
 * different product. renderAboutDocs()/bindAboutTabs() in card-chrome.mjs drive it.)
 * ---------------------------------------------------------------------------------- */
.about-docs {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}
.about-docs::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(80% 54% at 18% 0%,rgba(255,255,255,.11),transparent 58%), radial-gradient(54% 42% at 92% 18%,rgba(255,255,255,.06),transparent 62%);
}
.about-docs > * { position: relative; z-index: 1; }

/* Tabs FIT, never clip. auto-fit reflows to fewer columns (4 → 3 → 2) as the embed
   narrows instead of squeezing a long label like "Backstory" past the tab's edge —
   there are only ever ≤4 tabs, so a wide card still lays them out in one row. */
.about-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
}
.about-tab {
  display: flex;
  width: 100%;
  height: 86px;
  min-height: 86px;
  max-height: 86px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #577757;
  border-radius: 8px;
  padding: 12px 10px;
  background: #101312;
  color: #fff;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  /* last-resort guard: a single long word breaks rather than getting clipped */
  overflow-wrap: anywhere;
  hyphens: auto;
  transition: background .3s, border-color .3s, transform .2s;
}
.about-tab:hover,
.about-tab:active,
.about-tab.is-active {
  border-color: #577757;
  background: linear-gradient(0deg,rgba(56,255,56,.15),rgba(56,255,56,.15)), rgba(255,255,255,.08);
}
.about-tab:focus-visible {
  outline: 2px solid rgba(56,255,56,.70);
  outline-offset: 2px;
  background: linear-gradient(0deg,rgba(56,255,56,.15),rgba(56,255,56,.15)), rgba(255,255,255,.08);
}
.about-panel { margin-top: 16px; }
.about-swap {
  display: grid;
  gap: 16px;
  animation: docs-overview-swap-in 420ms cubic-bezier(.22,1,.36,1);
}
@keyframes docs-overview-swap-in {
  from { opacity: 0; transform: translateY(8px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.about-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}
.about-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  padding: 4px 12px;
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.75);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.35;
}
.about-text-block {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 16px;
  background: rgba(22,22,22,.53);
}
.about-section-label {
  color: #38ff38;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.about-copy { margin-top: 12px; }
.about-copy p {
  margin: 0;
  color: #e5e5e5;
  font-size: 16px;
  line-height: 1.625;
}
.about-copy p + p { margin-top: 12px; }

/* placed AFTER the .about-text-block base rule on purpose: same specificity, so source
   order decides — earlier in the file this bump was dead and the two cards' About
   text blocks disagreed (16px vs 20px). */
@media (min-width: 400px) {
  .about-text-block { padding: 20px; }
}

/* ── the DETAIL-ROW anatomy ────────────────────────────────────────────────────────
 * The rows every Card lists its fields in: label column LEFT (96px, Poppins caps),
 * value RIGHT, hairline divider between rows. .detail-preview is the CLICKABLE row
 * value (opens a dialog): a standing WHITE underline + a chevron at rest; on hover/focus
 * the underline brightens to #fff and only the CHEVRON takes the accent.
 * The underline never takes the accent — no surface in the family accents an underline
 * (business-space .linkish pins its underline neutral precisely so it will NOT follow the
 * text green; both .info-link implementations route the green to the border), and on a
 * Card --accent is the plugged reality's OWN brand hue sitting on glass already tinted
 * with it, so an accent hairline can vanish for an arbitrary brand. White always reads.
 * Lived separately in both cards (self-declared copies); one definition now.
 * ---------------------------------------------------------------------------------- */
.field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.16);
  /* the ink shadow the Reality Card carried on its <dl> — keeps copy legible on glass */
  text-shadow: 0 0 3px #0d100e, 0 0 6px #0d100e;
}
.field:first-child { border-top: 0; }
.field dt {
  width: 96px;
  flex: 0 0 96px;
  padding-top: 2px;
  color: rgba(255,255,255,.65);
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.field dd {
  min-width: 0;
  flex: 1;
  margin: 0;
  color: rgba(255,255,255,.90);
  font-size: 14px;
  line-height: 1.5;
}
.detail-preview {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
/* hover AND focus-visible — a keyboard user gets the same bloom a mouse does. */
.detail-preview:hover .preview-copy,
.detail-preview:focus-visible .preview-copy {
  color: #fff;
  /* the underline brightens WITH the copy, and stays white. Written explicitly: this
     used to ride on the `text-decoration` shorthand resetting decoration-color back to
     currentColor — correct, but invisible to anyone editing this rule (and one reorder
     away from silently reverting to the resting 32%). */
  text-decoration-color: #fff;
}
.detail-preview:hover .preview-arrow,
.detail-preview:focus-visible .preview-arrow { color: var(--accent, #38ff38); transform: translateX(2px); }
.detail-preview:focus-visible {
  outline: 1px solid rgba(56,255,56,.72);
  outline-offset: 3px;
}
.preview-copy {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* a STANDING underline: the row must read as clickable before you hover it */
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.32);
  text-underline-offset: 3px;
}
.preview-arrow {
  flex: 0 0 auto;
  color: rgba(255,255,255,.42);
  font-size: 20px;
  line-height: 1;
  transition: color .18s, transform .18s;
}
.preview-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 0 5px;
  background: rgba(0,0,0,.26);
  color: rgba(255,255,255,.58);
  font-family: "Poppins", sans-serif;
  font-size: 10px;
  line-height: 1;
}
