/*
  Ghostfader – Cinematic Dark UI (windowed)
  -------------------------------------------------
  CSS custom properties — set via admin panel or override inline.
    --gf-bg            : background of player surface
    --gf-chrome        : chrome bar background
    --gf-panel         : control bar background
    --gf-text          : primary text color
    --gf-muted         : subdued text/track color
    --gf-accent        : brand accent (buttons, knobs, active state)
    --gf-rail          : timeline rail color
    --gf-rail-active   : played portion color
    --gf-focus         : accessible focus outline
    --gf-radius        : global corner radius
    --gf-gap           : spacing unit
    --gf-shadow        : card shadow
*/

.ghostfader{
  --gf-bg: #1a1a1a;
  --gf-chrome: #222;
  --gf-panel: #232323;
  --gf-text: #f2f2f2;
  --gf-muted: #999;
  --gf-accent: #F1CA3C;
  --gf-rail: rgba(255,255,255,.15);
  --gf-rail-active: #d6b02a;
  --gf-focus: #8ab4f8;
  --gf-radius: 12px;
  --gf-gap: 10px;
  --gf-shadow: 0 12px 40px rgba(0,0,0,.35);

  /* v0.8.6: responsive container. max-width caps the player on wide
     viewports; width:100% lets it shrink fully on small ones; margin
     auto centers when the parent is wider than the cap. The CSS var
     defaults to 1280px when no per-player or shortcode override is
     emitted via build_style_attr(). The :fullscreen rule further down
     overrides max-width so fullscreen still fills the viewport. */
  max-width: var(--gf-max-width, 1280px);
  margin: 0 auto;
  width: 100%;

  position: relative;
  display: flex; flex-direction: column;
  border-radius: var(--gf-radius);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color: var(--gf-text);
  background: var(--gf-bg);
  overflow: hidden;
  box-shadow: var(--gf-shadow);
  line-height: 1.4;
}

/* ── Chrome bar (top) ────────────────────────────── */
.ghostfader .gf-chrome{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--gf-chrome);
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: 40px;
  flex-shrink: 0;
}

.ghostfader .gf-brand{
  width: 100px; height: auto;
  opacity: .7;
  pointer-events: none; user-select: none;
  flex-shrink: 0;
}

.ghostfader .gf-chrome-title{
  font-size: 13px; font-weight: 600; color: var(--gf-muted);
  letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ghostfader .gf-chrome-spacer{ flex: 1; }

.ghostfader .gf-help-btn{
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15); background: transparent;
  color: var(--gf-muted); font-size: 14px; font-weight: 700;
  cursor: pointer; display: grid; place-items: center;
  transition: color .15s ease, border-color .15s ease;
}
.ghostfader .gf-help-btn:hover{ color: var(--gf-text); border-color: rgba(255,255,255,.3); }
.ghostfader .gf-help-btn:focus-visible{ outline: 2px solid var(--gf-focus); outline-offset: 2px; }

/* ── Help modal ──────────────────────────────────── */
.ghostfader .gf-help-modal{
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.ghostfader .gf-help-modal[hidden]{ display: none; }

.ghostfader .gf-help-content{
  position: relative;
  background: #2a2a2a; border-radius: 10px; padding: 24px 28px;
  max-width: 340px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.ghostfader .gf-help-content h3{
  margin: 0 0 16px; font-size: 15px; font-weight: 700; color: var(--gf-text);
}
.ghostfader .gf-help-close{
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--gf-muted); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 4px;
}
.ghostfader .gf-help-close:hover{ color: var(--gf-text); }

.ghostfader .gf-shortcuts{
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px;
  margin: 0; font-size: 13px;
}
.ghostfader .gf-shortcuts dt{ text-align: right; color: var(--gf-text); }
.ghostfader .gf-shortcuts dd{ margin: 0; color: var(--gf-muted); }
.ghostfader .gf-shortcuts kbd{
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  font-family: inherit; font-size: 12px; color: var(--gf-text);
  line-height: 1.3;
}
.ghostfader .gf-help-footer{
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.ghostfader .gf-version{
  font-size: 11px; color: rgba(255,255,255,.3);
  letter-spacing: .04em;
}
.ghostfader .gf-support-link{
  font-size: 11px; color: var(--gf-accent);
  text-decoration: none; opacity: .7;
  transition: opacity .15s;
}
.ghostfader .gf-support-link:hover{ opacity: 1; }

/* ── Debug Info overlay (Shift+Ctrl+Click ? or I key) */
.ghostfader .gf-stats{
  position: absolute; top: 10px; left: 10px; z-index: 18;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #e8e8e8;
  font-family: 'Roboto Mono',ui-monospace,'Courier New',monospace;
  font-size: 11px; line-height: 1.65;
  border-radius: 6px; padding: 0;
  width: 300px;
  max-height: 80%;
  overflow-y: auto;
  /* pointer-events: auto (default) is required for the scrollbar + wheel
     to actually drive the overflow. Previously this rule was
     pointer-events: none to keep the overlay from intercepting clicks on
     the video underneath, but that also blocked scroll interaction on the
     panel itself — leaving the scrollbar visible but inert when content
     grew past max-height (e.g. with multiple stems' per-stem state). The
     video underneath has no click target in this region anyway (play /
     scrub / fullscreen all live in the dock), so receiving pointer events
     here is harmless. overscroll-behavior: contain stops scroll-chaining
     to the page when the panel hits a scroll boundary. */
  overscroll-behavior: contain;
  border: 1px solid rgba(255,255,255,.10);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.ghostfader .gf-sdebug{
  font-size: 9px; font-weight: 700; letter-spacing: .12em;
  color: var(--gf-accent, #F1CA3C); text-transform: uppercase;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0;
  background: rgba(0,0,0,.92);
}
.ghostfader .gf-stats-close{
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 20px; height: 20px; padding: 0;
  background: none; border: none; cursor: pointer;
  color: var(--gf-muted); font-size: 16px; line-height: 1;
  border-radius: 4px;
  transition: color .15s ease, background .15s ease;
}
.ghostfader .gf-stats-close:hover{ color: var(--gf-text); background: rgba(255,255,255,.10); }
.ghostfader .gf-stats-close:focus-visible{ outline: 2px solid var(--gf-focus); outline-offset: 1px; }
.ghostfader .gf-sh{
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  color: rgba(255,255,255,.35); text-transform: uppercase;
  padding: 6px 12px 2px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.ghostfader .gf-sr{
  display: flex; justify-content: space-between; gap: 12px;
  padding: 1px 12px; white-space: nowrap;
}
.ghostfader .gf-sl{ color: rgba(255,255,255,.4); flex-shrink: 0; }
.ghostfader .gf-sv{ color: #e8e8e8; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.ghostfader .gf-st{
  color: var(--gf-accent, #F1CA3C);
  padding: 2px 12px 10px; letter-spacing: .04em;
}

/* ── Media well (windowed — with padding) ────────── */
.ghostfader .gf-media{
  position: relative;
  padding: 10px 10px 0;
  background: var(--gf-bg);
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  min-height: 0; /* allow flex shrinking */
}

.ghostfader video.gf-video{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #000;
}

/* ── Dock (transport + stems) — below video ──────── */
.ghostfader .gf-dock{
  background: var(--gf-panel);
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

/* ── Transport row ───────────────────────────────── */
.ghostfader .gf-transport{
  display: flex; align-items: center;
  gap: var(--gf-gap);
}

/* Play button */
.ghostfader .gf-play{
  flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer; display: grid; place-items: center;
  background: var(--gf-accent); color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transition: transform .1s ease;
}
.ghostfader .gf-play:active{ transform: scale(.93); }
.ghostfader .gf-play:focus-visible{ outline: 3px solid var(--gf-focus); outline-offset: 3px; }
.ghostfader .gf-play[aria-pressed="true"] .icon-play{ display: none; }
.ghostfader .gf-play[aria-pressed="false"] .icon-pause{ display: none; }

/* Time labels */
.ghostfader .gf-time{
  font-size: 13px;
  font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums;
  color: var(--gf-text);
  flex-shrink: 0; min-width: 36px; text-align: center;
}
.ghostfader .gf-time--muted{ color: var(--gf-muted); }

/* Timeline */
.ghostfader .gf-timeline{ position: relative; height: 6px; border-radius: 6px; background: var(--gf-rail); flex: 1; min-width: 60px; }
.ghostfader .gf-timeline .gf-progress{ position:absolute; left:0; top:0; bottom:0; width:0%; background: var(--gf-rail-active); border-radius: 6px; }
.ghostfader .gf-timeline .gf-scrub{
  -webkit-appearance: none; appearance:none;
  position:absolute; left:0; right:0; top:50%; transform: translateY(-50%);
  height: 20px;
  background: none; width:100%; cursor: pointer;
}
.ghostfader .gf-scrub::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gf-accent); border: 2px solid rgba(0,0,0,.25);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.ghostfader .gf-scrub:focus-visible{ outline: none; }
.ghostfader .gf-scrub::-moz-range-thumb{
  width: 16px; height: 16px; border-radius:50%;
  background: var(--gf-accent); border: 2px solid rgba(0,0,0,.25);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.ghostfader .gf-scrub::-moz-range-track{ height: 6px; background:none; }

/* Fullscreen button */
.ghostfader .gf-fullscreen{
  flex-shrink: 0;
  width: 36px; height: 36px; border: none; border-radius: 6px;
  background: transparent; color: var(--gf-muted); cursor: pointer;
  display: grid; place-items: center;
  transition: color .15s ease;
}
.ghostfader .gf-fullscreen:hover{ color: var(--gf-text); }
.ghostfader .gf-fullscreen:focus-visible{ outline: 3px solid var(--gf-focus); outline-offset: 2px; }

/* Pin-controls-visible toggle (icon button alongside fullscreen).
   Lit when active (.is-on) — accent background + dark glyph, matching
   the .gf-toggle.is-on convention used by stem buttons. */
.ghostfader .gf-pin{
  flex-shrink: 0;
  width: 36px; height: 36px; border: none; border-radius: 6px;
  background: transparent; color: var(--gf-muted); cursor: pointer;
  display: grid; place-items: center;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.ghostfader .gf-pin:hover{ color: var(--gf-text); }
.ghostfader .gf-pin:focus-visible{ outline: 3px solid var(--gf-focus); outline-offset: 2px; }
.ghostfader .gf-pin.is-on{
  background: var(--gf-accent); color: #1a1a1a;
  box-shadow: 0 0 8px color-mix(in srgb, var(--gf-accent) 35%, transparent);
}

/* ── Stem bar ────────────────────────────────────── */
.ghostfader .gf-stem-bar{
  display: flex; align-items: center;
  gap: 8px;
  padding: 8px 0 0;
  flex-wrap: wrap;
}

.ghostfader .gf-stem-group{
  display: flex; align-items: center; gap: 6px;
}

/* Toggle button — lit/unlit */
.ghostfader .gf-toggle{
  appearance: none; border: none; cursor: pointer;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 6px;
  min-height: 32px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ghostfader .gf-toggle.is-on{
  background: var(--gf-accent); color: #1a1a1a;
  box-shadow: 0 0 8px color-mix(in srgb, var(--gf-accent) 35%, transparent);
}
.ghostfader .gf-toggle:not(.is-on){
  background: rgba(255,255,255,.1); color: var(--gf-muted);
}
.ghostfader .gf-toggle:hover:not(.is-on){
  background: rgba(255,255,255,.18); color: var(--gf-text);
}
.ghostfader .gf-toggle:focus-visible{ outline: 2px solid var(--gf-focus); outline-offset: 2px; border-radius: 6px; }

/* Per-stem fader (horizontal) */
.ghostfader .gf-stem-fader{
  -webkit-appearance: none; appearance: none;
  width: 56px; height: 4px; border-radius: 4px;
  background: var(--gf-rail); cursor: pointer;
}
.ghostfader .gf-stem-fader::-webkit-slider-thumb{
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gf-accent); border: 2px solid rgba(0,0,0,.3);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.ghostfader .gf-stem-fader::-webkit-slider-runnable-track{
  height: 4px; background: var(--gf-rail); border-radius: 4px;
}
.ghostfader .gf-stem-fader::-moz-range-thumb{
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gf-accent); border: 2px solid rgba(0,0,0,.3);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.ghostfader .gf-stem-fader::-moz-range-track{
  height: 4px; background: var(--gf-rail); border-radius: 4px;
}
.ghostfader .gf-stem-fader:focus-visible{ outline: 2px solid var(--gf-focus); outline-offset: 2px; border-radius: 4px; }

/* Reset button */
.ghostfader .gf-reset{
  appearance: none; border: 1px solid rgba(255,255,255,.15); border-radius: 6px;
  background: transparent; color: var(--gf-muted); padding: 5px 12px;
  font-size: 11px; cursor: pointer; letter-spacing: .03em; margin-left: auto;
  min-height: 32px;
  transition: color .15s ease, border-color .15s ease;
}
.ghostfader .gf-reset:hover{ color: var(--gf-text); border-color: rgba(255,255,255,.3); }
.ghostfader .gf-reset:focus-visible{ outline: 2px solid var(--gf-focus); outline-offset: 2px; }

/* ── Tooltips (CSS-only) ─────────────────────────── */
[data-tooltip]{ position: relative; }
[data-tooltip]::after{
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); opacity: 0;
  padding: 4px 8px; border-radius: 4px;
  background: rgba(0,0,0,.9); color: #fff;
  font-size: 11px; font-weight: 400; white-space: nowrap;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 10;
}
[data-tooltip]:hover::after{ opacity: 1; }
@media (hover: none){ [data-tooltip]::after{ display: none; } }

/* Tooltip overflow safety — keep edge-control tooltips inside the player frame
   (the player has overflow:hidden in normal + fullscreen). Middle controls keep
   the centered default; only edge cases flip to inside-anchored. */
.ghostfader .gf-help-btn[data-tooltip]::after{
  /* Top-right of chrome — flip below the button + right-anchor */
  bottom: auto;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  transform: none;
}
.ghostfader .gf-play[data-tooltip]::after,
.ghostfader .gf-stem-bar .gf-stem-group:first-child .gf-toggle[data-tooltip]::after{
  /* Left-edge controls — anchor tooltip to the button's left edge */
  left: 0;
  transform: none;
}
.ghostfader .gf-fullscreen[data-tooltip]::after,
.ghostfader .gf-reset[data-tooltip]::after{
  /* Right-edge controls — anchor tooltip to the button's right edge */
  left: auto;
  right: 0;
  transform: none;
}

/* ── Awaiting first play — controls grayed out ───── */
.ghostfader.gf-awaiting-play .gf-dock{
  filter: saturate(0) brightness(.7);
  transition: filter .3s ease;
}
.ghostfader.gf-awaiting-play:hover .gf-dock,
.ghostfader.gf-awaiting-play:focus-within .gf-dock{
  filter: saturate(.5) brightness(.85);
}

/* ── Overlay / states ────────────────────────────── */
.ghostfader .gf-overlay{
  position:absolute; inset:0; display:grid; place-items:center; z-index: 5;
  background: radial-gradient(100% 120% at 50% 40%, rgba(0,0,0,.15), rgba(0,0,0,.5));
  color: var(--gf-text);
}
.ghostfader .gf-spinner{ font-weight: 600; letter-spacing:.04em; background: rgba(0,0,0,.4); padding: 10px 14px; border-radius: 10px; }

/* Buffering state */
.ghostfader.gf-buffering .gf-progress{ animation: gf-pulse .8s ease-in-out infinite alternate; }
@keyframes gf-pulse{ from{ opacity:1; } to{ opacity:.4; } }

/* Disabled gate */
.ghostfader.gf-disabled{ filter: saturate(.3) opacity(.8); }
.ghostfader.gf-disabled .gf-dock{ pointer-events:none; }

/* Hi-contrast focus for a11y */
@supports selector(:focus-visible){
  .ghostfader :focus{ outline: none; }
}

/* ── Prebuffer gate (v0.8.3) — fill ring + slow-connection notice ── */
.ghostfader .gf-play{ position: relative; }

.ghostfader .gf-prebuffer-ring{
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  pointer-events: none;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity .25s ease;
}
.ghostfader.gf-prebuffering .gf-prebuffer-ring{ opacity: 1; }

.ghostfader .gf-prebuffer-ring-bg{
  fill: none;
  stroke: rgba(255,255,255,.15);
  stroke-width: 2;
}
.ghostfader .gf-prebuffer-ring-fg{
  fill: none;
  stroke: var(--gf-accent, #fff);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 100.531;  /* 2πr, r=16 */
  stroke-dashoffset: calc(100.531 * (1 - var(--gf-prebuffer-progress, 0)));
  transition: stroke-dashoffset .15s linear;
}

/* Escalating prebuffer status — informational at 15s, warning + countdown at 30s.
   Sync is the contract; no bypass is offered. Sits above the dock. */
.ghostfader .gf-prebuffer-status{
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--gf-muted);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0 12px;
  transition: opacity .3s ease, max-height .3s ease, padding .3s ease, color .3s ease, background .3s ease;
}
.ghostfader.gf-status-loading .gf-prebuffer-status,
.ghostfader.gf-status-warning .gf-prebuffer-status{
  opacity: 1;
  max-height: 32px;
  padding: 6px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.25);
}
.ghostfader.gf-status-warning .gf-prebuffer-status{
  color: var(--gf-accent, #F1CA3C);
  background: rgba(60,30,0,.35);
}
.ghostfader .gf-prebuffer-status-text{
  letter-spacing: .02em;
}

/* While the prebuffer gate is active, dim the dock slightly so the ring is
   the visual focus. Don't desaturate — that flattens the ring's accent color
   against the play button background and makes the fill invisible. */
.ghostfader.gf-prebuffering .gf-dock{
  filter: brightness(.85);
}

/* Halt overlay — shown when 60s timeout fires or a media error occurs.
   Replaces the previous "Play anyway" escape hatch with an honest dead-end +
   Retry button. Sync is the contract; bypass is not offered. */
.ghostfader.gf-halted .gf-halt{
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.ghostfader.gf-halted .gf-halt-card{
  max-width: 360px;
  padding: 24px 28px;
  border-radius: 10px;
  background: #2a2a2a;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.ghostfader.gf-halted .gf-halt-title{
  font-weight: 700;
  color: var(--gf-text);
  margin-bottom: 8px;
  font-size: 14px;
}
.ghostfader.gf-halted .gf-halt-detail{
  color: var(--gf-muted);
  font-size: 12px;
  margin-bottom: 16px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.ghostfader.gf-halted .gf-halt-retry{
  appearance: none;
  border: 1px solid var(--gf-accent, #F1CA3C);
  background: transparent;
  color: var(--gf-accent, #F1CA3C);
  padding: 6px 18px;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  letter-spacing: .02em;
  transition: background .15s ease, color .15s ease;
}
.ghostfader.gf-halted .gf-halt-retry:hover{
  background: var(--gf-accent, #F1CA3C);
  color: #1a1a1a;
}
.ghostfader.gf-halted .gf-halt-retry:focus-visible{
  outline: 2px solid var(--gf-focus);
  outline-offset: 2px;
}

/* ── Fullscreen ──────────────────────────────────── */
/* Video fills the entire viewport; chrome (top) and dock (bottom) float
   on top as overlays with subtle gradient backdrops. When the gf-idle
   class lands after 3s of pointer inactivity (see Dock idle auto-hide
   in ghostfader.js), both overlays fade and the cursor hides, leaving
   only the video. The previous flex-column layout left a grey dock
   strip behind after fade because the dock's height stayed in flow;
   absolute positioning makes the fade actually clean. */
.ghostfader:fullscreen{
  border-radius: 0;
  height: 100vh;
  background: #000; /* unified backdrop; dock/chrome gradients sit on this */
}
.ghostfader:fullscreen .gf-media{
  position: absolute; inset: 0;
  padding: 0;
}
.ghostfader:fullscreen video.gf-video{
  border-radius: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.ghostfader:fullscreen .gf-chrome{
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0));
  border-bottom: 0;
  transition: opacity .3s ease, transform .3s ease;
}
.ghostfader:fullscreen .gf-dock{
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.35));
  border-top: 0;
  transition: opacity .3s ease, transform .3s ease;
}
/* Auto-hide chrome + dock + cursor when idle in fullscreen */
.ghostfader:fullscreen.gf-idle .gf-chrome{
  opacity: 0; transform: translateY(-8px);
  pointer-events: none;
}
.ghostfader:fullscreen.gf-idle .gf-dock{
  opacity: 0; transform: translateY(8px);
  pointer-events: none;
}
.ghostfader:fullscreen.gf-idle{
  cursor: none;
}

/* ── Access gate (v0.8.6) — login + register card ── */
/* Rendered by Ghostfader_Access::render_gate() in place of post content
   when a logged-out visitor hits a player they can't access. Replaces
   the bare wp-login.php redirect. The gate runs inside the theme's
   page template, so theme typography wraps it; we use existing player
   design tokens (--gf-bg, --gf-accent, etc.) with literal fallbacks
   so the card looks right even though .ghostfader isn't its ancestor. */
.gf-gate{
  display: flex; align-items: center; justify-content: center;
  min-height: 50vh;
  padding: clamp(24px, 6vw, 64px) 0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}
.gf-gate-card{
  width: 100%; max-width: 420px;
  padding: 32px;
  border-radius: 12px;
  background: #1a1a1a;
  color: #f2f2f2;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  line-height: 1.5;
}
.gf-gate-card .gf-gate-title{
  margin: 0 0 8px; font-size: 18px; font-weight: 700;
  color: inherit;
}
.gf-gate-card .gf-gate-desc{
  margin: 0 0 20px; font-size: 14px; color: #999;
}
.gf-gate-card .login{ margin: 0; }
.gf-gate-card .login p{ margin: 0 0 12px; }
.gf-gate-card .login label{
  display: block; font-size: 13px; color: #cfcfcf; margin-bottom: 4px;
}
.gf-gate-card .login input[type="text"],
.gf-gate-card .login input[type="password"]{
  width: 100%; box-sizing: border-box;
  padding: 8px 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  color: #f2f2f2;
  font: inherit;
}
.gf-gate-card .login input[type="text"]:focus,
.gf-gate-card .login input[type="password"]:focus{
  outline: 2px solid #8ab4f8; outline-offset: 1px;
  border-color: rgba(255,255,255,.35);
}
.gf-gate-card .login-remember{ font-size: 13px; color: #cfcfcf; }
.gf-gate-card .login-remember label{ display: inline; margin: 0; }
.gf-gate-card .login-submit input[type="submit"]{
  background: #F1CA3C;
  color: #1a1a1a;
  border: 0;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.gf-gate-card .login-submit input[type="submit"]:hover{
  filter: brightness(1.05);
}
.gf-gate-card .login-submit input[type="submit"]:focus-visible{
  outline: 3px solid #8ab4f8; outline-offset: 2px;
}
.gf-gate-links{
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 16px; font-size: 13px;
}
.gf-gate-links a{
  color: #F1CA3C; text-decoration: none;
}
.gf-gate-links a:hover,
.gf-gate-links a:focus-visible{ text-decoration: underline; }
.gf-gate-links a:focus-visible{ outline: 2px solid #8ab4f8; outline-offset: 2px; border-radius: 2px; }

/* ── Mobile responsive ───────────────────────────── */
@media (max-width: 600px){
  .ghostfader .gf-chrome{ padding: 6px 10px; min-height: 36px; }
  .ghostfader .gf-brand{ width: 80px; }
  .ghostfader .gf-chrome-title{ font-size: 11px; }
  .ghostfader .gf-media{ padding: 6px 6px 0; }
  .ghostfader .gf-dock{ padding: 8px 10px; }
  .ghostfader .gf-transport{ gap: 6px; }
  .ghostfader .gf-play{ width: 44px; height: 44px; }
  .ghostfader .gf-time{ font-size: 11px; min-width: 30px; }
  .ghostfader .gf-stem-bar{ gap: 4px; padding: 6px 0 0; }
  .ghostfader .gf-toggle{ font-size: 11px; padding: 6px 10px; min-height: 44px; }
  .ghostfader .gf-stem-fader{ width: 44px; height: 20px; }
  .ghostfader .gf-reset{ min-height: 44px; padding: 6px 10px; }
  .ghostfader .gf-fullscreen{ width: 44px; height: 44px; }
}

/* ── Light mode variant ──────────────────────────── */
@media (prefers-color-scheme: light){
  .ghostfader[data-theme="auto"]{
    --gf-bg:#f6f6f6; --gf-chrome:#eee; --gf-panel:#f0f0f0;
    --gf-text:#0f0f0f; --gf-muted:#666; --gf-rail:rgba(0,0,0,.12);
    --gf-rail-active:#2f2f2f;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }
}
