/* The playground on /playground (MDS captures 2026/11/17/161921, 163108 and 163556): the SFX Lab's layout and styles (sfx-lab lab.css:
   the rails of cards, the stage, the play module and its timeline, the phone rows) on the docs page, in the text column and the site's grays (site.css
   and docs.css: #111111 ground, #1c1c1c as the menu's current page, #9a9899 text, #2e2e2e lines), with the home's pink on the stage.
   The pink is the home tile's own background: --tile-bg, which tools/sync-home-from-lab.py writes into assets/site-type.css from the
   home's Tune default, so a change there changes this (MDS, capture 2026/11/18/091816). The gradient after it is the fallback. Before: The pink is the home tile's gradient (.cap-tile, read from the live home on 17 Nov). */
.pg-lab {
  --pg-pink: var(--tile-bg, radial-gradient(57% 35% at 20.2% 65%, rgba(255, 136, 237, .525), rgba(255, 136, 237, 0)),
    radial-gradient(35% 36% at 104% 11%, rgba(245, 122, 213, .976), rgba(245, 122, 213, 0)),
    radial-gradient(41% 45% at 56.8% 101.7%, rgba(243, 205, 227, .686), rgba(243, 205, 227, 0)),
    radial-gradient(32% 48% at 107% 60.2%, rgba(204, 202, 246, .635), rgba(204, 202, 246, 0)),
    radial-gradient(46% 43% at 111.2% 96.3%, rgba(215, 230, 233, .937), rgba(215, 230, 233, 0)),
    radial-gradient(49% 52% at 24.5% 105.3%, rgb(206, 194, 248), rgba(206, 194, 248, 0)),
    radial-gradient(100% 43% at 16.7% 39.3%, rgba(245, 115, 206, .737), rgba(245, 115, 206, 0)),
    radial-gradient(28% 111% at -13% 69.5%, rgb(225, 238, 248), rgba(225, 238, 248, 0)),
    linear-gradient(rgb(254, 167, 229), rgb(246, 114, 209) 42.8%, rgb(236, 197, 236)));
  --tray: #1c1c1c;
  --card-hover: #202020;
  --card-on: #2a2a2a;
  --active: #30d158;
  --blush: #f0b9e5;   /* the app's sounds; green stays the person's own voice in the capsule (MDS, capture 2026/11/18/094733) */
  --line: #2e2e2e;
  --foreground: #e7e7e7;
  --name: #9a9899;
  --dim: #6f6d6e;
  --skeleton: #2e2e2e;
  --skeleton-on: #464546;
  --pill: rgb(255 255 255 / .12);
  --space: 12px;
  container: pglab / inline-size;
  margin: 48px 0 0;
  color: var(--foreground);
  font: 400 14px/20px var(--sys, -apple-system, BlinkMacSystemFont, sans-serif);
}
.pg-lab *, .pg-lab *::before, .pg-lab *::after { box-sizing: border-box; }
.pg-lab button { margin: 0; font: inherit; color: inherit; cursor: pointer; }
.pg-lab :focus-visible { outline: 2px solid #9a9899; outline-offset: 2px; }

/* The scenes on the left, the stage and play module in the middle, the sounds on the right. */
.pg-lab .shell { display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: 150px minmax(0, 1fr) 150px; gap: var(--space);
  height: clamp(480px, 70vh, 640px); }
.pg-lab .left { display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); grid-area: 1 / 2; gap: var(--space); min-height: 0; }
.pg-lab #scene-grid { grid-area: 1 / 1; }
.pg-lab #grid { grid-area: 1 / 3; }
.pg-lab .wave { --head: var(--foreground); display: block; width: 100%; color: var(--dim); }

/* The stage: the capsule on the pink. */
.pg-lab .tray { position: relative; display: flex; flex-direction: column; grid-row: 1 / 5; min-height: 0; border-radius: 16px; }
.pg-lab .stage-area { --window-top: 44px; --specimen-scale: 1; --capsule-drop: 0px; position: relative; display: grid; flex: 1; place-items: center; min-height: 0;
  overflow: hidden; border-radius: 16px; background: var(--pg-pink); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.pg-lab .stage { display: grid; grid-area: 1 / 1; place-items: center; width: 100%; height: 100%; pointer-events: none; translate: 0 var(--capsule-drop); }

/* A made-up card above the capsule, for a capture to land on (the lab's specimen), in white on the pink. */
.pg-lab .fake-ui { position: absolute; top: var(--window-top); left: 50%; z-index: 1; display: grid; place-items: center; width: var(--specimen-width, 300px); height: 72px;
  pointer-events: none; transform-origin: top center; scale: var(--specimen-scale); translate: -50% 0; }
.pg-lab .no-card .fake-ui { display: none; }
.pg-lab [data-target] { position: relative; }
.pg-lab .sp-card { display: flex; gap: 12px; align-items: center; width: 100%; height: 100%; padding: 12px; border-radius: 12px; background: rgb(255 255 255 / .3); }
.pg-lab .sp-thumb { flex: none; width: 48px; height: 48px; border-radius: 8px; background: rgb(255 255 255 / .45); }
.pg-lab .sp-lines { display: flex; flex: 1; flex-direction: column; gap: 8px; }
.pg-lab .sp-lines span { height: 8px; border-radius: 4px; background: rgb(255 255 255 / .45); }
.pg-lab .sp-lines span:last-child { width: 60%; }
.pg-lab .sp-button { flex: none; width: 56px; height: 24px; border-radius: 12px; background: rgb(255 255 255 / .45); }
.pg-lab .capture-outline { position: absolute; inset: -5px; box-shadow: inset 0 0 0 2.5px #0a84ff; border-radius: 17px; }
.pg-lab .capture-outline[data-area='hero'] { border-radius: 13px; }
.pg-lab .capture-outline[hidden] { display: none; }
.pg-lab .capture-tag, .pg-lab .ink-tag { position: absolute; left: 50%; translate: -50% 0; padding: 2px 8px; border-radius: 9px; color: #fff; font-size: 11px;
  font-weight: 500; line-height: 18px; white-space: nowrap; }
.pg-lab .capture-tag { bottom: calc(100% + 6px); background: #0071e3; } /* the website's blue, 4.67:1 with white; the app keeps #0a84ff */
.pg-lab .ink-tag { bottom: calc(100% + 12px); background: #d70015; opacity: 0; } /* the website's red, 5.38:1 with white; the ink stroke keeps the app's #ff3b30 */
.pg-lab .ink { position: absolute; top: -9px; left: -12px; width: 80px; height: 42px; overflow: visible; opacity: 0; }
.pg-lab .ink path { fill: none; stroke: #ff3b30; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

/* The play module: Play and the timeline, as tall as a rail card. */
.pg-lab .panel { --edge: calc((100cqh - 56px) / 2); position: relative; z-index: 4; grid-row: 5; container-type: size; border-radius: 16px; background: var(--tray); }
.pg-lab .panel-row { position: relative; display: flex; gap: 24px; align-items: center; height: 100%; padding: 0 var(--edge); }
.pg-lab .transport { display: grid; flex: none; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--pill); color: var(--foreground); }
.pg-lab .transport svg { scale: 1.5; }
.pg-lab .transport:hover { background: rgb(255 255 255 / .18); }
.pg-lab .timeline { flex: 1; min-width: 0; cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.pg-lab .track { position: relative; height: 30px; }
.pg-lab .clips { position: absolute; inset: 0; }
.pg-lab .clips::before { position: absolute; top: 14.5px; right: 0; left: 0; height: 1px; background: var(--line); content: ''; }
.pg-lab .clip { position: absolute; top: 0; bottom: 0; min-width: 3px; }
.pg-lab .clip .wave { position: absolute; top: -17px; right: 0; left: 0; height: 64px; color: var(--blush); }
.pg-lab .playhead { position: absolute; top: 0; z-index: 2; width: 1px; height: 30px; background: var(--foreground); pointer-events: none; translate: -50% 0; }
.pg-lab .playhead::before { position: absolute; top: 0; left: 50%; width: 11px; height: 10px; background: var(--foreground); clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%);
  content: ''; translate: -50% 0; }

/* The rails of cards. */
.pg-lab .family-grid { display: grid; grid-auto-rows: minmax(0, 1fr); gap: var(--space); min-width: 0; min-height: 0; overflow: hidden; }
.pg-lab .block-spot { position: relative; min-width: 0; min-height: 0; }
.pg-lab .block { display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; height: 100%; padding: 14px 16px; border: 0; border-radius: 16px;
  background: var(--tray); text-align: left; transition: background-color .12s ease; }
@media (hover: hover) {
  .pg-lab .block-spot:hover .block { background: var(--card-hover); }
  .pg-lab .block-spot:hover .wave { color: #a19fa0; }
}
.pg-lab .block[aria-pressed='true'], .pg-lab .block-spot:hover .block[aria-pressed='true'] { background: var(--card-on); }
.pg-lab .block[aria-pressed='true'] .block-name { color: #fff; }
.pg-lab .block-head { display: flex; flex: none; align-items: baseline; justify-content: space-between; gap: 8px; }
.pg-lab .block-name { overflow: hidden; flex: none; color: var(--name); font-size: 15px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.pg-lab .block .wave { flex: 1; height: 0; min-height: 0; }
.pg-lab .block[aria-pressed='true'] .wave { color: var(--blush); }

/* A scene card's skeleton of the capsule at the scene's telling moment. */
.pg-lab .scene-icon { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 0; }
.pg-lab .skeleton { display: flex; gap: 8px; align-items: center; height: 30px; padding: 0 6px 0 11px; border-radius: 999px; background: var(--skeleton); zoom: .9; }
.pg-lab .block[aria-pressed='true'] .skeleton { background: var(--skeleton-on); }
.pg-lab .skeleton i { display: block; flex: none; border-radius: 999px; background: currentColor; }
.pg-lab .skeleton .dot { width: 8px; height: 8px; }
.pg-lab .skeleton .line { height: 5px; }
.pg-lab .skeleton .ghost { width: 18px; height: 18px; }
.pg-lab .skeleton .white { color: var(--foreground); }
.pg-lab .skeleton .gray { color: #8a8a8a; }
.pg-lab .skeleton .green { color: var(--active); }
.pg-lab .skeleton .red { color: #ff453a; }

/* Narrow: the scenes on top, the stage and play module in the middle, the sounds below, each row swiping on its own. */
@container pglab (max-width: 700px) {
  .pg-lab .shell { grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); height: 620px; }
  .pg-lab #scene-grid { grid-area: 1 / 1; }
  .pg-lab #grid { grid-area: 3 / 1; }
  .pg-lab .left { display: flex; flex-direction: column; grid-area: 2 / 1; }
  .pg-lab .tray { flex: 1; }
  .pg-lab .panel { flex: none; container-type: normal; }
  .pg-lab .panel-row { gap: 16px; height: auto; padding: 14px; }
  .pg-lab .clip { min-width: 24px; }
  /* The rows fade at an end that has more past it, as the phone's menu does, so a half-seen card says there's more: the right end until
     the row is scrolled to its end, the left end once it's scrolled (MDS capture 2026/11/17/173645). playground.js sets --sl and --sr. */
  .pg-lab .family-grid { --fl: calc(var(--e0, 0px) + (56px - var(--e0, 0px)) * var(--sl, 0)); --fr: calc(56px * var(--sr, 1)); display: flex; height: 48px; padding-right: 48px; overflow: auto hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); }
  .pg-lab .family-grid::-webkit-scrollbar { display: none; }
  .pg-lab .family-grid .block-spot { flex: none; height: 100%; scroll-snap-align: start; }
  .pg-lab .block { flex-direction: row; gap: 14px; align-items: center; width: auto; padding: 0 16px; }
  .pg-lab .block .wave { flex: none; width: 56px; height: 26px; }
  .pg-lab .scene-icon { flex: none; }
  .pg-lab .skeleton { zoom: .66; }
}
/* On a phone the rows run to both window edges and fade at both ends, exactly as the menu row does (docs.css, capture 141206) */
@media (max-width: 760px) {
  .pg-lab .family-grid { --g: 16px; --e0: var(--g); margin: 0 calc(-1 * var(--g)); padding: 0 48px 0 var(--g); scroll-padding-left: var(--g); }
}
@media (min-width: 601px) and (max-width: 760px) { .pg-lab .family-grid { --g: 24px; } }
/* The fades grow and shrink with the scroll (playground.js sets --sl and --sr, 0 to 1 over the first and last 56 px), so the left fade
   melts away as a row glides home instead of switching off (MDS, 18 Nov). */
@media (prefers-reduced-motion: reduce) { .pg-lab .block { transition: none; } }

/* On load each row shows its far end, then glides back to the start, so it's plain the row runs on past the edge (MDS captures
   2026/11/18/092628 and 093649: "start at this view and then go, whoop, to this view"). playground.js runs it and adds .shown; until
   then the rows are hidden so the far end doesn't flash, and they show on their own after a moment if the script never runs. */
.pg-lab .family-grid:not(.shown) { opacity: 0; animation: pg-row-show 0s 1.2s forwards; }
@keyframes pg-row-show { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pg-lab .family-grid:not(.shown) { opacity: 1; animation: none; } }
