/* wFX FX menu look — matches PluginGridComponent + WfxFilterChipStyle */

:root {
  --wfx-bg: #0a0a0a;
  /* WfxFilterChipStyle.h */
  --wfx-chip-fill: #0c0c0c;
  --wfx-chip-fill-bright: #141414;
  /* RackSlotComponent CategoryChipsComponent::paint: selected white, else 0x33ffffff */
  --wfx-chip-text-dim: rgba(255, 255, 255, 0.2); /* 0x33 / 255 */
  --wfx-chip-text-sel: #ffffff;
  /* PluginEditor drawable deselected icons 0x14ffffff; selected 0xB3ffffff */
  --wfx-header-icon-dim: rgba(255, 255, 255, 0.07843137);
  --wfx-header-icon-sel: rgba(255, 255, 255, 0.70196078); /* 0xB3 / 255 */
  /* PluginGridComponent thumb slot — fixed logical size (not scaled with host uiGlobalScaleFactor) */
  --wfx-thumb-w: 120px;
  --wfx-thumb-h: 152px;
  /* 5-column thumb strip + gutters (matches .fx-grid max-width) */
  --wfx-thumb-grid-max: calc(5 * var(--wfx-thumb-w) + 4 * 12px + 16px);
  /* paint: drawRoundedRectangle(thumbRect.expanded(3.0f), …) — frame sits outside the 120×152 slot */
  --wfx-thumb-border-outset: 3px;
  /*
   * Thumb **title** only: default host uses uiGlobalScaleFactor 0.8f (PluginProcessor.h), so names paint smaller
   * than raw 22px CSS on the same 120×152 slot. Scale font + shadow offsets only; strip stays 30px like paint().
   */
  --wfx-thumb-title-paint-scale: 0.8;
  --wfx-thumb-title-font: calc(22px * var(--wfx-thumb-title-paint-scale));
  --wfx-thumb-title-d2: calc(2px * var(--wfx-thumb-title-paint-scale));
  --wfx-thumb-title-d1: calc(1px * var(--wfx-thumb-title-paint-scale));
  /* Bottom title band — same 30/152 ratio as PluginGridComponent thumbRect */
  --wfx-thumb-title-strip: calc(var(--wfx-thumb-h) * 30 / 152);
  /* PluginGrid baseline uses 0x18ffffff; slightly boosted here so the outset ring reads on sRGB */
  --wfx-border-subtle: rgba(255, 255, 255, 0.094);
  --wfx-thumb-frame-line: rgba(255, 255, 255, 0.16);
  --wfx-border-hover: #4a90e2;
  --wfx-dim: 0.32;
  /* PluginGridComponent::paint thumb title — dimColour() ARGB alphas (byte / 255) */
  --wfx-thumb-lbl-sh-outer: calc(54 / 255); /* 0x36000000 */
  --wfx-thumb-lbl-sh-mid: calc(69 / 255); /* 0x45000000 */
  --wfx-thumb-lbl-sh-contact: calc(120 / 255); /* 0x78000000 */
  --wfx-thumb-lbl-fill-lo: calc(68 / 255); /* 0x44ffffff */
  --wfx-thumb-lbl-fill-hi: calc(85 / 255); /* 0x55ffffff */
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.45);
  --accent: #4a90e2;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--wfx-bg);
  color: var(--text);
}

/* Intro scrim from below real header — GIF at intrinsic size; scroll if needed */
.wfx-intro-splash {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Set in JS from `.wfx-header` bottom; fallback ~ header block before paint */
  top: var(--wfx-intro-top, 5.75rem);
  z-index: 250;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  /* Extra top padding sits the GIF a little lower under the header */
  padding: 40px max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  background: var(--wfx-bg);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.wfx-intro-splash.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.wfx-intro-active .wfx-header-thumb-chrome .filter-buy-btn {
  visibility: hidden;
  pointer-events: none;
}

.wfx-intro-splash__btn {
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  transition: outline-color 0.15s ease, opacity 0.2s ease;
}

.wfx-intro-splash__btn:hover {
  opacity: 0.96;
}

/* No default focus ring around the GIF; keyboard users still get :focus-visible */
.wfx-intro-splash__btn:focus {
  outline: none;
}

.wfx-intro-splash__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.wfx-intro-splash__gif {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border: 0;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .wfx-intro-splash {
    transition-duration: 0.01ms;
  }

  .wfx-intro-splash__btn {
    transition-duration: 0.01ms;
  }
}

/*
 * Lock layout to the viewport. Grid row `minmax(0, 1fr)` lets <main> shrink so the footer
 * never gets clipped — a plain `1fr` / flex min-height:auto can grow past 100dvh and hide Contact.
 * (100% chain from html/body; 100dvh where supported for mobile dynamic toolbars.)
 */
.wfx-shell {
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

/* Header — wFX title; Buy + settings aligned to thumb grid (overlay track) */
.wfx-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  overflow-x: visible;
  /* Title is one row (wFX + byline); extra air before chrome + filters */
  padding: 20px 14px 18px;
  background: var(--wfx-bg);
}

/*
 * Same width as thumb grid — settings left, GET right (inverse), same baseline above filters.
 */
.wfx-header-thumb-chrome {
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 4;
  align-self: stretch;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  max-width: var(--wfx-thumb-grid-max);
  margin: 0 auto;
  padding-bottom: 2px;
  box-sizing: border-box;
  pointer-events: none;
}

/* GET — Contact-style pill; default shows price, GET on hover; press darkens */
.wfx-header-thumb-chrome .filter-buy-btn {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: var(--wfx-chip-fill-bright);
  color: var(--wfx-chip-text-sel);
  box-sizing: border-box;
  min-width: 4.25rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wfx-header-thumb-chrome .filter-buy-get {
  display: none;
}

.wfx-header-thumb-chrome .filter-buy-price {
  display: inline;
}

.wfx-header-thumb-chrome .filter-buy-btn:hover .filter-buy-get,
.wfx-header-thumb-chrome .filter-buy-btn:focus-visible .filter-buy-get {
  display: inline;
}

.wfx-header-thumb-chrome .filter-buy-btn:hover .filter-buy-price,
.wfx-header-thumb-chrome .filter-buy-btn:focus-visible .filter-buy-price {
  display: none;
}

.wfx-header-thumb-chrome .filter-buy-btn:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.wfx-header-thumb-chrome .filter-buy-btn:active {
  background: #060606;
  border-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.wfx-header-thumb-chrome .filter-buy-btn:active .filter-buy-get {
  display: inline;
}

.wfx-header-thumb-chrome .filter-buy-btn:active .filter-buy-price {
  display: none;
}

.wfx-shell--rack .wfx-header-thumb-chrome .filter-buy-btn {
  display: none;
}

.wfx-header-settings {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 6px 8px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  pointer-events: auto;
  align-self: flex-end;
}

.wfx-header-settings:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.wfx-header-settings:hover .wfx-header-burger,
.wfx-header-settings:hover .wfx-header-burger::before {
  border-color: var(--wfx-header-icon-sel);
}

/* wFX + byline — one row: large bold mark, smaller lighter credit to the right */
.wfx-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 18px;
  max-width: 100%;
  line-height: 1.05;
  text-align: center;
  letter-spacing: 0.02em;
}

.wfx-title-brand {
  display: inline-block;
  font-size: clamp(1.75rem, 4.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1;
  transform: translateY(calc(0.26em - 5px));
}

.wfx-title-by {
  display: inline;
  position: static;
  transform: none;
  margin: 0;
  padding-bottom: 0.08em;
  font-family: "Reenie Beanie", cursive;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.42);
  white-space: nowrap;
}

.wfx-shell--rack .wfx-title {
  cursor: pointer;
  user-select: none;
}

.wfx-shell--rack .wfx-title:hover .wfx-title-brand {
  color: var(--wfx-header-icon-sel);
}

.wfx-shell--rack .wfx-title:hover .wfx-title-by {
  color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 520px) {
  .wfx-title {
    gap: 0 6px;
  }

  .wfx-header {
    padding-top: 18px;
    padding-bottom: 14px;
  }
}

.wfx-header-icon {
  display: block;
}

/* Decorative menu lines — same ~8% white as WF / deselected header icons (PluginEditor settings des 0x14ffffff) */
.wfx-header-burger {
  width: 14px;
  height: 10px;
  border-top: 1.5px solid var(--wfx-header-icon-dim);
  border-bottom: 1.5px solid var(--wfx-header-icon-dim);
  position: relative;
}

.wfx-header-burger::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: -0.5px;
  border-top: 1.5px solid var(--wfx-header-icon-dim);
}

/* Filter row — less padding below chips pulls them closer to the thumb grid */
.wfx-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 4px;
  background: var(--wfx-bg);
}

/* Main: two swap views (FX grid vs rack slot scroll) — height comes from shell grid row */
.wfx-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 20px;
}

/*
 * FX mode: <main> is the thumb grid scrollport (shell height is fixed to the viewport).
 * Rack mode: clip <main>; scroll only inside .wfx-rack-viewport.
 */
.wfx-shell:not(.wfx-shell--rack) .wfx-main {
  overflow-y: auto;
  overflow-x: hidden;
}

/* No visible scrollbar gutter — matches flat dark UI; wheel / trackpad / touch still scroll */
.wfx-shell:not(.wfx-shell--rack) .wfx-main,
.wfx-rack-viewport,
.detail-panel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.wfx-shell:not(.wfx-shell--rack) .wfx-main::-webkit-scrollbar,
.wfx-rack-viewport::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.wfx-shell.wfx-shell--rack .wfx-main {
  overflow: hidden;
}

/* `.wfx-view` uses `display:flex` — without this, that rule can override `[hidden]` and both views stay in flow */
.wfx-main > .wfx-view[hidden] {
  display: none !important;
}

.wfx-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wfx-shell:not(.wfx-shell--rack) .wfx-view--fx {
  flex: 0 0 auto;
  overflow: visible;
}

.wfx-shell.wfx-shell--rack .wfx-view--rack {
  flex: 1;
  min-height: 0;
}

/* Rack viewport — stacked “slot” cards, scrolls like wFX editor rack area */
.wfx-view--rack {
  align-items: center;
}

.wfx-rack-viewport {
  width: 100%;
  max-width: 680px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  padding: 0 10px 24px;
  -webkit-overflow-scrolling: touch;
}

.wfx-rack-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wfx-slot-card {
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #141414;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.wfx-slot-card.is-dimmed {
  opacity: var(--wfx-dim);
}

.wfx-slot-card.is-dimmed:hover {
  opacity: 0.55;
}

.wfx-slot-body {
  margin: 0;
  padding: 0;
  border: none;
  width: 100%;
  display: block;
  background: #0a0a0a;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.wfx-slot-body:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: -2px;
}

.wfx-slot-body img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(52vh, 370px);
  object-fit: contain;
  object-position: top center;
}

.fx-grid {
  display: grid;
  grid-template-columns: repeat(5, var(--wfx-thumb-w));
  gap: 12px;
  justify-content: center;
  max-width: var(--wfx-thumb-grid-max);
  margin: 0 auto;
}

/* Site footer — last row of .wfx-shell grid; Contact stays above the fold while <main> scrolls */
.site-footer {
  width: 100%;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #080808;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer-inner {
  width: 100%;
  max-width: var(--wfx-thumb-grid-max);
  margin: 0 auto;
  text-align: center;
}

@media (max-width: 720px) {
  :root {
    /*
     * Same 5-column strip as desktop; shrink slot to fit (main 8px horizontal padding, four 12px gaps).
     * Title strip + type scale with thumb so the cell still reads like the plugin grid.
     */
    --wfx-thumb-w: min(120px, calc((100vw - 16px - 48px) / 5));
    --wfx-thumb-h: calc(var(--wfx-thumb-w) * 152 / 120);
    --wfx-thumb-grid-max: calc(5 * var(--wfx-thumb-w) + 4 * 12px + 16px);
    --wfx-thumb-title-font: calc(var(--wfx-thumb-w) * 0.147);
    --wfx-thumb-title-d2: calc(var(--wfx-thumb-w) * 0.01333);
    --wfx-thumb-title-d1: calc(var(--wfx-thumb-w) * 0.00667);
  }

  .wfx-header-thumb-chrome {
    max-width: 100%;
  }

  .fx-grid {
    grid-template-columns: repeat(5, var(--wfx-thumb-w));
    max-width: 100%;
  }

  .site-footer-inner {
    max-width: 100%;
  }
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.site-footer-nav .site-footer-btn {
  padding: 6px 14px;
  font-size: 12px;
}

.site-footer-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--wfx-chip-text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer-link:hover {
  color: rgba(255, 255, 255, 0.55);
}

.site-footer-link:focus-visible,
.site-footer-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Primary footer action — reads as a button without breaking the dark UI */
.site-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wfx-chip-text-sel);
  text-decoration: none;
  background: var(--wfx-chip-fill-bright);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-footer-btn:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.site-footer-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.02em;
}

/* Thumb cell — 120×152 art slot; border drawn outside like wFX thumbRect.expanded(3) */
.fx-thumb {
  width: var(--wfx-thumb-w);
  height: var(--wfx-thumb-h);
  position: relative;
  padding: 0;
  margin: 0;
  border: none;
  background: var(--wfx-bg);
  border-radius: 2px;
  overflow: visible;
  transition: opacity 0.2s ease;
}

/* Baseline + hover strokes (same expanded rect as PluginGridComponent paint) */
.fx-thumb::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--wfx-thumb-border-outset));
  border-radius: 1px;
  border: 1px solid var(--wfx-thumb-frame-line);
  pointer-events: none;
  z-index: 1;
  transition: border-width 0.1s ease, border-color 0.1s ease;
}

.fx-thumb:hover::after {
  border-width: 2px;
  border-color: var(--wfx-border-hover);
}

.fx-thumb-main:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.fx-thumb.is-dimmed {
  opacity: var(--wfx-dim);
}

.fx-thumb:hover.is-dimmed {
  opacity: 0.55;
}

/* Main click target: fixed slot size; image fills entire slot under label */
.fx-thumb-main {
  position: relative;
  display: block;
  width: var(--wfx-thumb-w);
  height: var(--wfx-thumb-h);
  padding: 0;
  margin: 0;
  border: none;
  background: var(--wfx-bg);
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  z-index: 0;
}

/* wFX draws thumbs at native res centered in the slot (clip to rect) — avoid cover-scale blur */
.fx-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  background: var(--wfx-bg);
  pointer-events: none;
  image-rendering: auto;
}

@supports (image-rendering: high-quality) {
  .fx-thumb-img {
    image-rendering: high-quality;
  }
}

/*
 * PluginGridComponent::paint — thumb title (lines 719–756):
 * Font(22, bold); textBounds = thumb bottom 30px; drawText(..., centred, useEllipsis=true);
 * Shadow passes: 0x36 @ ±2 (8-way), 0x45 @ 1px (4-way, no 1,1), 0x78 @ (1,1);
 * then 0x44ffffff, then 0x55ffffff. Colours use dimColour(ARGB) when thumb is dimmed — parent .fx-thumb.is-dimmed opacity matches.
 */
.fx-thumb-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--wfx-thumb-title-strip);
  z-index: 2;
  box-sizing: border-box;
  color: transparent;
  pointer-events: none;
  overflow: hidden;
}

.fx-thumb-label::before,
.fx-thumb-label::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  min-width: 0;
  height: var(--wfx-thumb-title-strip);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--wfx-thumb-title-font);
  font-weight: 700;
  line-height: 1.05;
  padding-bottom: 1px;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.fx-thumb-label::before {
  z-index: 1;
  color: rgb(255 255 255 / var(--wfx-thumb-lbl-fill-lo));
  text-shadow:
    var(--wfx-thumb-title-d2) 0 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    calc(-1 * var(--wfx-thumb-title-d2)) 0 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    0 var(--wfx-thumb-title-d2) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    0 calc(-1 * var(--wfx-thumb-title-d2)) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    var(--wfx-thumb-title-d2) var(--wfx-thumb-title-d2) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    calc(-1 * var(--wfx-thumb-title-d2)) var(--wfx-thumb-title-d2) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    var(--wfx-thumb-title-d2) calc(-1 * var(--wfx-thumb-title-d2)) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    calc(-1 * var(--wfx-thumb-title-d2)) calc(-1 * var(--wfx-thumb-title-d2)) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-outer)),
    var(--wfx-thumb-title-d1) 0 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-mid)),
    0 var(--wfx-thumb-title-d1) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-mid)),
    calc(-1 * var(--wfx-thumb-title-d1)) var(--wfx-thumb-title-d1) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-mid)),
    var(--wfx-thumb-title-d1) calc(-1 * var(--wfx-thumb-title-d1)) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-mid)),
    var(--wfx-thumb-title-d1) var(--wfx-thumb-title-d1) 0 rgb(0 0 0 / var(--wfx-thumb-lbl-sh-contact));
}

.fx-thumb-label::after {
  z-index: 2;
  color: rgb(255 255 255 / var(--wfx-thumb-lbl-fill-hi));
  text-shadow: none;
}

/* Info (i) — top-right on thumb hover; blurb shows when hovering the icon */
.fx-thumb-info {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: help;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.fx-thumb:hover .fx-thumb-info {
  display: flex;
}

.fx-thumb-info img {
  width: 16px;
  height: 16px;
  opacity: 0.55;
  filter: invert(1);
}

.fx-thumb-info:hover,
.fx-thumb-info:focus {
  background: rgba(74, 144, 226, 0.22);
  box-shadow: 0 0 0 1.2px rgba(74, 144, 226, 0.75);
}

.fx-thumb-info:hover img,
.fx-thumb-info:focus img {
  opacity: 1;
}

/* Blurb overlay — only while pointer is over the info control */
.fx-thumb-blurb {
  position: absolute;
  inset: 0 0 var(--wfx-thumb-title-strip) 0;
  padding: 8px 6px;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(0, 0, 0, 0.48);
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
}

.fx-thumb:has(.fx-thumb-info:hover) .fx-thumb-blurb,
.fx-thumb:has(.fx-thumb-info:focus-visible) .fx-thumb-blurb {
  display: flex;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.filter-chip {
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 7px 12px;
  border: none;
  border-radius: 3px;
  background: var(--wfx-chip-fill);
  color: var(--wfx-chip-text-dim);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

/* wFX chips have no separate hover paint — keep dim text; nudge fill only slightly */
.filter-chip:hover:not(.is-active) {
  background: #0e0e0e;
  color: var(--wfx-chip-text-dim);
}

.filter-chip.is-active {
  background: var(--wfx-chip-fill-bright);
  color: var(--wfx-chip-text-sel);
}

/* Full-screen scrim only (no blur) — dim around the modal */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

/* Closed overlay still covers the viewport — let clicks reach the shell (WF, grid, chips) */
.detail-overlay[aria-hidden="true"] {
  pointer-events: none;
}

.detail-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Settings — slots diagram scaled down to fit the viewport (scrollbars hidden) */
.slots-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top, 0px)) max(36px, env(safe-area-inset-right, 0px)) max(28px, env(safe-area-inset-bottom, 0px)) max(36px, env(safe-area-inset-left, 0px));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.slots-overlay[aria-hidden="true"] {
  pointer-events: none;
}

.slots-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.slots-overlay__scroll {
  --slots-cap-w: min(960px, calc(100vw - 80px));
  --slots-cap-h: min(86vh, calc(100dvh - 104px));
  width: fit-content;
  max-width: var(--slots-cap-w);
  max-height: var(--slots-cap-h);
  margin: auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  line-height: 0;
}

.slots-overlay__scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.slots-overlay__img {
  display: block;
  width: auto;
  height: auto;
  max-width: var(--slots-cap-w);
  max-height: var(--slots-cap-h);
}

.slots-overlay__close {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 111;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 10, 0.75);
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.slots-overlay__close:hover {
  color: var(--text);
  background: rgba(24, 24, 24, 0.9);
}

.slots-overlay__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.slots-overlay[aria-hidden="false"] .slots-overlay__close {
  display: none;
}

.slots-overlay:focus {
  outline: none;
}

@media (max-width: 520px) {
  .slots-overlay {
    padding: max(20px, env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
  }

  .slots-overlay__scroll {
    --slots-cap-w: calc(100vw - 40px);
    --slots-cap-h: min(88vh, calc(100dvh - 80px));
  }
}

/* Arrows flank the panel (original layout); backgrounds stayed removed — glyph + hover only */
.detail-modal-shell {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.detail-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 88px;
  padding: 0 4px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.detail-nav:hover {
  color: rgba(255, 255, 255, 0.95);
}

.detail-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .detail-modal-shell {
    gap: 4px;
  }

  .detail-nav {
    width: 38px;
    min-height: 72px;
    font-size: 1.55rem;
  }

  .detail-overlay {
    padding: max(10px, env(safe-area-inset-top, 0px)) 10px 12px;
  }

  .detail-panel {
    max-width: 100%;
    width: 100%;
    padding: 16px 12px 18px;
    max-height: min(90vh, 100dvh - 20px);
  }

  .detail-content {
    padding-left: 0;
    padding-right: 0;
  }

  .detail-learn-panel {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Fixed 10.5rem + nowrap overflows narrow modals — stack like a card list */
  .detail-knob-item {
    grid-template-columns: 1fr;
  }

  .detail-knob-label {
    border-right: none;
    border-bottom: 1px solid var(--detail-info-grid);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    padding: 8px 10px 6px;
  }

  .detail-knob-desc {
    padding: 8px 10px 12px;
    min-height: 0;
    text-align: center;
  }
}

.detail-panel {
  width: 100%;
  max-width: min(720px, 96vw);
  max-height: 90vh;
  overflow: auto;
  scrollbar-gutter: stable;
  /* Was solid #141414 — translucent so the thumb grid reads through the popup chrome */
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 22px 22px 24px;
  position: relative;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.detail-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.detail-content {
  padding-left: 28px;
  padding-right: 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* GUI shot: same outward border ring as thumbs (expanded rect) */
.detail-gui-wrap {
  position: relative;
  align-self: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 18px;
  line-height: 0;
  border: none;
  border-radius: 2px;
  overflow: visible;
}

.detail-gui-wrap::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--wfx-thumb-border-outset));
  border-radius: 1px;
  border: 1px solid var(--wfx-thumb-frame-line);
  pointer-events: none;
  z-index: 1;
  transition: border-width 0.1s ease, border-color 0.1s ease;
}

.detail-gui-wrap:hover::after {
  border-width: 2px;
  border-color: var(--wfx-border-hover);
}

.detail-gui-wrap img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(75vh, 640px);
  transition: opacity 0.14s ease;
}

/* Avoid flashing the previous effect’s GUI while the new image loads */
.detail-gui-wrap img.wfx-img-loading {
  opacity: 0;
}

.detail-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.detail-tagline {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
  text-align: center;
  align-self: center;
  max-width: 40rem;
}

.detail-description {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  align-self: center;
  max-width: 40rem;
}

/* Learn more — table-like grid: real borders, not a tiled background */
.detail-learn-panel {
  --detail-info-grid: rgba(0, 0, 0, 0.92);

  align-self: center;
  width: min(40rem, 100%);
  box-sizing: border-box;
  margin: 18px auto 24px;
  padding: 0;
  border: 1px solid var(--detail-info-grid);
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
}

.detail-knob-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-knob-item {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  align-items: stretch;
  column-gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--detail-info-grid);
}

.detail-knob-item:last-child {
  border-bottom: none;
}

.detail-knob-item.detail-knob-fallback {
  display: block;
  padding: 14px 12px;
  border-bottom: none;
}

.detail-knob-label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px;
  min-width: 0;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.3;
  text-align: center;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--detail-info-grid);
  box-sizing: border-box;
}

.detail-knob-desc {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  margin: 0;
  padding: 10px 10px 10px 12px;
  min-width: 0;
  width: 100%;
  /* Row height: just under 2 lines of copy + vertical padding */
  min-height: calc(10px + (1.75 * 0.84rem * 1.45) + 10px);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  color: var(--text-muted);
  box-sizing: border-box;
}

.detail-knob-fallback-text {
  display: block;
  margin: 0;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-muted);
}

.detail-note {
  margin: 20px 0 0;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
  box-sizing: border-box;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #3a82d4;
  color: #fff;
}

.btn-secondary {
  background: var(--wfx-chip-fill-bright);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: #1a1a1a;
  color: var(--text);
}

