/* Vice Blind: styles injected into every page. Everything keys off [data-vb]. */

/* The overlay is positioned against the card. :where() keeps specificity at zero, so a card that
 * already has its own `position` keeps it. */
:where([data-vb="blur"], [data-vb="cover"]) { position: relative; }

[data-vb="remove"] { display: none !important; }

[data-vb="blur"]::after,
[data-vb="cover"]::after {
  content: "Spoiler hidden\A Click twice to show";
  position: absolute;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-content: center;
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: pre;
  text-align: center;
  font: 600 13px/1.55 "Jost", "Futura", "Century Gothic", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  color: #ffe9d6;
  text-shadow: 0 0 10px rgba(255, 62, 150, 0.85), 0 1px 2px rgba(18, 6, 42, 0.9);
  cursor: pointer;
  pointer-events: auto;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 143, 191, 0.4);
}

/* Light through blinds: plum slats over the blur. */
[data-vb="blur"]::after {
  background: repeating-linear-gradient(180deg, rgba(27, 10, 51, 0.76) 0 5px, rgba(27, 10, 51, 0.5) 5px 9px);
  -webkit-backdrop-filter: blur(18px) saturate(0.6);
  backdrop-filter: blur(18px) saturate(0.6);
}
[data-vb="cover"]::after { background: repeating-linear-gradient(180deg, #1b0a33 0 5px, #2a1048 5px 9px); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  [data-vb="blur"]::after { background: #1b0a33; }
}

/* Belt and braces: the card's own children are blurred or hidden too, so nothing leaks if
 * backdrop-filter is missing or slow. */
[data-vb="blur"] > * { filter: blur(14px) saturate(0.5) !important; }
[data-vb="cover"] > * { visibility: hidden !important; }

/* Reveal modes change the label. */
html[data-vb-reveal="one"] [data-vb]::after { content: "Spoiler hidden\A Click to show"; }
html[data-vb-reveal="locked"] [data-vb]::after { content: "Spoiler hidden\A Locked in settings"; cursor: not-allowed; }

/* First click of two: armed. */
html [data-vb][data-vb-armed]::after {
  content: "Armed\A Click again to show";
  box-shadow: inset 0 0 0 2px #ff3e96, inset 0 0 22px rgba(255, 62, 150, 0.45);
  color: #fff;
}

/* Replaced elements cannot show ::after, so they are filtered instead. */
:is(img, video, canvas, picture, iframe, embed, object)[data-vb="blur"] {
  filter: blur(26px) saturate(0.5) !important;
  cursor: pointer;
}
:is(img, video, canvas, picture, iframe, embed, object)[data-vb="cover"] {
  filter: brightness(0) !important;
  cursor: pointer;
}
:is(img, video, canvas, picture, iframe, embed, object)[data-vb][data-vb-armed] {
  outline: 2px solid #ff3e96;
  outline-offset: -2px;
}
