/* Shared interface components (design pass, 25 Nov; docs/DESIGN_TWEAKS_2026-11-25.md, "Shared components").
   Every control here is a SKIN over an existing control: the original buttons / selects / range stay in the page,
   hidden, and keep their ids, state and handlers. This file only draws; static/js/wf-ui.js wires.
   Components: breadcrumb (.wfu-crumbs), player menu (.wfu-usermenu), pill dropdown (.wfu-pill), segmented control
   (.wfu-seg), picker field (.wfu-pf, a pill whose popover holds several bubble groups), drum (.wfu-drum),
   glow slider (.wfu-sl), edit link (.wfu-edit), and the decision helpers. */

/* ── the hidden original ───────────────────────────────────────────────── */
.wfu-src { display: none !important; }

/* ── breadcrumb ─────────────────────────────────────────────────────────── */
.wfu-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 0 0 22px; padding: 0; list-style: none;
  font-family: var(--fm); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.wfu-crumbs li { display: flex; align-items: center; }
.wfu-crumbs li:not(:last-child)::after { content: "\203A"; margin: 0 12px; color: var(--ink-dim); font-size: 16px; }
.wfu-crumbs a { color: var(--ink-2); padding: 6px 2px; border-bottom: 1px solid transparent; transition: color 200ms, border-color 200ms; }
.wfu-crumbs a:hover, .wfu-crumbs a:focus-visible { color: var(--acc); border-bottom-color: var(--acc); outline: none; }
.wfu-crumbs [aria-current] { color: var(--acc); font-weight: 600; padding: 6px 2px; }

/* ── player menu (top right) ───────────────────────────────────────────── */
.wfu-usermenu { position: relative; }
.wfu-avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--bd-ctl); background: rgba(255, 255, 255, 0.04);
  color: var(--ink); font-family: var(--fm); font-size: 13px; letter-spacing: 0.06em; cursor: pointer; display: grid; place-items: center;
  text-transform: uppercase; transition: border-color 200ms, color 200ms, background 200ms; padding: 0; }
.wfu-avatar:hover, .wfu-usermenu.is-open .wfu-avatar { border-color: var(--acc); color: var(--acc); background: rgba(255, 255, 255, 0.07); }
.wfu-avatar:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.wfu-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px; z-index: 60;
  background: #0e0e14; border: 1px solid var(--bd-ctl); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden; transition: opacity 160ms ease, transform 160ms ease, visibility 160ms; }
.wfu-usermenu.is-open .wfu-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.wfu-menu-who { padding: 10px 12px 12px; border-bottom: 1px solid var(--bd-2); margin-bottom: 6px; }
.wfu-menu-name { display: block; font-size: 16px; color: var(--ink); }
.wfu-menu-sub { display: block; margin-top: 2px; font-family: var(--fm); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.wfu-menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; color: var(--ink-2);
  font-family: var(--fm); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.wfu-menu a:hover, .wfu-menu a:focus-visible { background: rgba(255, 255, 255, 0.07); color: var(--acc); outline: none; }
.wfu-menu svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wfu-menu hr { border: 0; border-top: 1px solid var(--bd-2); margin: 6px 0; }

/* ── edit link (plain gold text + arrow; pills are for choosing, this just goes somewhere) ─────────── */
.wfu-edit { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 2px 0; color: var(--acc);
  font-family: var(--fm); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid transparent;
  transition: border-color 200ms, gap 200ms; }
.wfu-edit:hover, .wfu-edit:focus-visible { border-bottom-color: var(--acc); gap: 12px; outline: none; }
.wfu-edit .ar { font-size: 15px; line-height: 1; }

/* ── pill dropdown ─────────────────────────────────────────────────────── */
.wfu-pill { display: inline-block; position: relative; vertical-align: top; }
.wfu-pill-btn { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px 9px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--fb); font-size: 16px; font-weight: 400; color: var(--ink); text-align: left;
  background: color-mix(in srgb, var(--acc) 9%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 50%, transparent);
  transition: background 200ms, border-color 200ms; }
.wfu-pill-btn:hover, .wfu-pill.is-open .wfu-pill-btn { background: color-mix(in srgb, var(--acc) 18%, transparent); border-color: var(--acc); }
.wfu-pill-btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.wfu-pill-btn.is-blank { background: transparent; border-style: dashed; border-color: var(--bd-ctl); }
.wfu-pill-btn svg { width: 18px; height: 18px; flex: none; stroke: var(--ink-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms; }
.wfu-pill.is-open .wfu-pill-btn svg { transform: rotate(180deg); stroke: var(--acc); }
.wfu-pk { font-family: var(--fm); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.wfu-pv { color: var(--ink); }
.wfu-pv.is-empty { color: var(--ink-faint); font-style: italic; font-size: 15px; }
.wfu-sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); display: inline-block; vertical-align: -2px; margin-right: 6px; }
.wfu-list { position: absolute; left: 0; top: calc(100% + 8px); z-index: 50; min-width: min(430px, 86vw); max-height: 360px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: #0e0e14; border: 1px solid var(--bd-ctl); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden; transition: opacity 150ms, transform 150ms, visibility 150ms; }
.wfu-pill.is-open .wfu-list { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.wfu-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 6px; cursor: pointer; font-size: 17px; color: var(--ink-2); }
.wfu-list li .d { font-family: var(--fm); font-size: 11px; letter-spacing: 0.03em; color: var(--ink-dim); }
.wfu-list li:hover, .wfu-list li.is-act { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.wfu-list li[aria-selected="true"] { color: var(--acc); }
.wfu-note { margin: 9px 4px 0; font-size: 14px; color: var(--ink-dim); line-height: 1.5; max-width: 62ch; }

/* ── segmented control ─────────────────────────────────────────────────── */
.wfu-seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 12px; max-width: 640px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--bd-ctl); }
.wfu-seg .th { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 9px; background: var(--acc); transition: transform 300ms cubic-bezier(0.3, 0.8, 0.2, 1); }
.wfu-seg button { position: relative; z-index: 1; background: transparent; border: 0; cursor: pointer; padding: 11px 8px; border-radius: 9px; color: var(--ink-2);
  font-family: var(--fb); font-size: 15px; line-height: 1.2; transition: color 200ms; }
.wfu-seg button:hover { color: var(--ink); }
.wfu-seg button[aria-checked="true"] { color: var(--on-acc, #0b0a10); font-weight: 600; }
.wfu-seg button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.wfu-seg--caps button { font-family: var(--fm); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }

/* ── picker field (a pill whose popover holds several bubble groups) ───── */
.wfu-pf { display: inline-block; position: relative; vertical-align: top; }
.wfu-pop { position: absolute; left: 0; top: calc(100% + 8px); z-index: 55; width: min(520px, 86vw); padding: 16px 16px 12px;
  background: #0e0e14; border: 1px solid var(--bd-ctl); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden; transition: opacity 150ms, transform 150ms, visibility 150ms; }
.wfu-pf.is-open .wfu-pop { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.wfu-pf.is-open .wfu-pill-btn { background: color-mix(in srgb, var(--acc) 18%, transparent); border-color: var(--acc); }
.wfu-pf.is-open .wfu-pill-btn svg { transform: rotate(180deg); stroke: var(--acc); }
.wfu-sec + .wfu-sec { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--bd-2); }
.wfu-sec h4 { margin: 0 0 9px; font-family: var(--fm); font-weight: 400; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.wfu-bub { display: flex; flex-wrap: wrap; gap: 8px; }
.wfu-bub button { cursor: pointer; background: transparent; border: 1px solid var(--bd-ctl); border-radius: 999px; padding: 8px 14px; color: var(--ink-2);
  font-family: var(--fm); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.wfu-bub button:hover { border-color: var(--acc); color: var(--ink); }
.wfu-bub button[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--on-acc, #0b0a10); font-weight: 600; }
.wfu-swr { display: flex; flex-wrap: wrap; gap: 10px; }
.wfu-swr button { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); padding: 0; }
.wfu-swr button:hover { transform: scale(1.08); }
.wfu-swr button[aria-pressed="true"] { border-color: var(--acc); box-shadow: 0 0 0 3px #0e0e14, 0 0 0 5px var(--acc); }
.wfu-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.wfu-foot button { background: none; border: 0; color: var(--ink-dim); font-family: var(--fm); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; padding: 6px 0; }
.wfu-foot button:hover { color: var(--ink); }
.wfu-foot span { font-family: var(--fm); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-dim); }

/* ── drum (sub-genre wheel) ────────────────────────────────────────────── */
.wfu-drumrow { display: flex; align-items: stretch; gap: 18px; max-width: 560px; }
.wfu-drum { position: relative; flex: 1; height: 264px; perspective: 760px; overflow: hidden; border-radius: 12px; touch-action: none; cursor: grab; user-select: none; outline: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(255, 255, 255, 0.02) 30%, rgba(255, 255, 255, 0.02) 70%, rgba(0, 0, 0, 0.55)); border: 1px solid var(--bd-2); }
.wfu-drum:focus-visible { border-color: var(--acc); }
.wfu-drum:active { cursor: grabbing; }
.wfu-drum .it { position: absolute; left: 0; right: 0; top: 50%; height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 14px; text-align: center;
  font-family: var(--fm); font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); will-change: transform, opacity; backface-visibility: hidden; }
.wfu-drum .it.on { color: var(--acc); font-weight: 600; }
.wfu-window { position: absolute; left: 10px; right: 10px; top: 50%; height: 48px; transform: translateY(-50%); border: 1px solid var(--acc); border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 24px color-mix(in srgb, var(--acc) 30%, transparent), inset 0 0 18px color-mix(in srgb, var(--acc) 12%, transparent); }
.wfu-lever { position: relative; width: 46px; flex: none; }
.wfu-rail { position: absolute; left: 50%; top: 10px; bottom: 10px; width: 8px; margin-left: -4px; border-radius: 6px; background: linear-gradient(90deg, #15151c, #2a2a36, #15151c); border: 1px solid var(--bd-2); }
.wfu-knob { position: absolute; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--acc) 70%, white), var(--acc) 55%, color-mix(in srgb, var(--acc) 45%, black)); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.35); }
.wfu-knob:active { cursor: grabbing; }
.wfu-knob:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.wfu-drumhint { margin: 8px 0 0; font-family: var(--fm); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-dim); text-transform: none; }

/* ── glow slider ───────────────────────────────────────────────────────── */
.wfu-sl { position: relative; height: 44px; margin: 14px 8px 0; touch-action: none; cursor: pointer; user-select: none; outline: none; --g: 0.55; }
.wfu-sl--plain { height: 26px; margin: 6px 6px 0; }
.wfu-sl-rail { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.wfu-sl-fill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 3px; width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 55%, #000), var(--acc));
  box-shadow: 0 0 calc(4px + var(--g) * 16px) color-mix(in srgb, var(--acc) calc(25% + var(--g) * 65%), transparent), 0 0 calc(var(--g) * 34px) color-mix(in srgb, var(--acc) calc(var(--g) * 55%), transparent); }
.wfu-sl-notch { position: absolute; top: 50%; width: 2px; height: 12px; margin: -6px 0 0 -1px; background: rgba(255, 255, 255, 0.34); border-radius: 1px; }
.wfu-sl-notch.on { background: var(--acc); }
.wfu-sl-nl { position: absolute; top: calc(50% + 14px); transform: translateX(-50%); font-family: var(--fm); font-size: 11px; color: var(--ink-dim); letter-spacing: 0.06em; }
.wfu-sl-nl.on { color: var(--ink); }
.wfu-sl-thumb { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 calc(6px + var(--g) * 20px) color-mix(in srgb, var(--acc) calc(30% + var(--g) * 65%), transparent), 0 2px 8px rgba(0, 0, 0, 0.6); }
.wfu-sl:not(.is-drag) .wfu-sl-thumb { transition: left 280ms cubic-bezier(0.3, 0.8, 0.2, 1), box-shadow 200ms; }
.wfu-sl:not(.is-drag) .wfu-sl-fill { transition: width 280ms cubic-bezier(0.3, 0.8, 0.2, 1), box-shadow 200ms; }
.wfu-sl:focus-visible .wfu-sl-thumb { outline: 2px solid var(--acc); outline-offset: 3px; }
.wfu-sl.is-eleven .wfu-sl-fill { background: linear-gradient(90deg, var(--acc), #fff2cf); box-shadow: 0 0 20px rgba(255, 214, 130, 0.95), 0 0 46px rgba(255, 190, 90, 0.7); }
.wfu-sl.is-eleven .wfu-sl-thumb { background: #fff8e6; box-shadow: 0 0 18px 4px rgba(255, 214, 130, 0.95), 0 0 50px 12px rgba(255, 170, 70, 0.6); animation: wfu-pulse 1600ms ease-in-out infinite; }
@keyframes wfu-pulse { 50% { box-shadow: 0 0 12px 2px rgba(255, 214, 130, 0.7), 0 0 30px 6px rgba(255, 170, 70, 0.4); } }
.wfu-sl-thumb.is-strain { animation: wfu-strain 340ms ease; }
@keyframes wfu-strain { 0% { transform: translateX(0); } 20% { transform: translateX(7px); } 40% { transform: translateX(-3px); } 60% { transform: translateX(4px); } 100% { transform: none; } }
.wfu-sl-thumb.is-charging { animation: wfu-charge 1100ms ease-in forwards; }
@keyframes wfu-charge { 0% { transform: translateX(0); box-shadow: 0 0 14px 2px rgba(255, 214, 130, 0.5); } 30% { transform: translateX(2px); } 50% { transform: translateX(-2px); } 70% { transform: translateX(3px); }
  100% { transform: translateX(-3px); box-shadow: 0 0 40px 14px rgba(255, 214, 130, 1), 0 0 90px 30px rgba(255, 170, 70, 0.7); } }
/* the soft halo behind a glowing dial row */
.wfu-glowrow { position: relative; }
.wfu-glowrow::before { content: ""; position: absolute; inset: -30px -90px; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(transparent, #000 30%, #000 70%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-composite: intersect;
  background: radial-gradient(ellipse 38% 48% at calc(10% + var(--gxn, 0.5) * 80%) 76%, color-mix(in srgb, var(--acc) calc(var(--g, 0.5) * 20%), transparent), transparent 100%); }
.wfu-glowrow.is-eleven::before { background: radial-gradient(ellipse 42% 55% at 90% 76%, rgba(255, 235, 190, 0.34), color-mix(in srgb, var(--acc) 22%, transparent) 50%, transparent 100%); animation: wfu-breathe 2400ms ease-in-out infinite; }
@keyframes wfu-breathe { 50% { opacity: 0.65; } }

@media (prefers-reduced-motion: reduce) {
  .wfu-sl-thumb, .wfu-sl-fill, .wfu-seg .th, .wfu-glowrow::before { transition: none !important; animation: none !important; }
}

/* ── How do you want to play?: segmented control, one panel ───────────────────────────────────────────── */
.wf-hp .wfu-seg { max-width: none; }
.wfu-seg.is-eleven .th { background: #ff5a5a; }
.wfu-mode { margin-top: 14px; padding: 22px 24px 20px; border-radius: 14px; border: 1px solid var(--bd-2); background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)); }
.wfu-mode-head h3 { margin: 0; font-family: var(--fh); font-weight: 400; font-size: 28px; color: var(--ink); }
.wfu-mode-desc { margin: 10px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 58ch; }
.wfu-mode-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bd-2); }
.wfu-mode-rows[hidden] { display: none; }
.wfu-row { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-dim); }
.wfu-row .d { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--bd-ctl); flex: none; }
.wfu-row .st { margin-left: auto; font-family: var(--fm); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.wfu-row.is-on { color: var(--ink); } .wfu-row.is-on .d { background: var(--acc); border-color: var(--acc); } .wfu-row.is-on .st { color: var(--acc); }
.wfu-row.is-na { color: var(--ink-faint); } .wfu-row.is-na .d { opacity: 0.4; }
/* Custom: the page's own switches, drawn as toggles */
.wf-hp-custom.wfu-custom { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--bd-2); gap: 12px 22px; }
.wf-hp-custom.wfu-custom .wf-hp-switch { justify-content: space-between; cursor: pointer; font-size: 15px; font-weight: 400; color: var(--ink); }
.wf-hp-custom.wfu-custom .wf-hp-switch input { appearance: none; -webkit-appearance: none; order: 2; position: relative; width: 38px; height: 22px; border-radius: 12px; background: rgba(255, 255, 255, 0.14); transition: background 200ms; flex: none; cursor: pointer; }
.wf-hp-custom.wfu-custom .wf-hp-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 200ms; }
.wf-hp-custom.wfu-custom .wf-hp-switch input:checked { background: var(--acc); }
.wf-hp-custom.wfu-custom .wf-hp-switch input:checked::after { transform: translateX(16px); background: #0b0a10; }
.wf-hp-custom.wfu-custom .wf-hp-switch input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
@media (max-width: 560px) { .wfu-mode-rows { grid-template-columns: 1fr; } }

/* an open list paints over what comes after it */
.wfu-raised { position: relative; z-index: 40; }
.wfu-up { z-index: 60; }

/* stacked pills in a column (the Build page's world-shape questions, the romance options) */
.wfu-stack .wfu-pill, #wf-rom-row .wfu-pill, #wf-era-row .wfu-pill { display: block; width: fit-content; margin: 0 0 14px; }

/* the shared header bar, for the older pages that do not load wf-forge.css */
.wf-forge-head { display: flex; align-items: center; gap: 22px; padding-bottom: 26px; }
.wf-forge-head .wf-spacer { flex: 1; }

/* The Home button (owner, 25 Nov): first in every header's top left, back to the page with your worlds */
.wfu-home { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border-radius: 10px; flex: none;
  border: 1px solid var(--bd-ctl); background: rgba(255, 255, 255, 0.04); color: var(--ink-2); text-decoration: none;
  font-family: var(--fm); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 6px; }
.wfu-home svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wfu-home:hover, .wfu-home:focus-visible { color: var(--acc); border-color: var(--acc); background: rgba(255, 255, 255, 0.07); outline: none; }
@media (max-width: 560px) { .wfu-home { padding: 0; width: 38px; justify-content: center; margin-right: 2px; } .wfu-home span { display: none; } }
