/* SocialZap · page styles for the gun, the paint and the wipe.
   Shared by the practice range and the X add-on, so everything is prefixed
   and self-contained (no page tokens). */

.inkgun-rig {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 2147483000;
  pointer-events: none;
}
.inkgun-rail {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 3px;
  height: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(128, 134, 148, 0.7) 0 12px, rgba(128, 134, 148, 0.25) 12px 16px);
  opacity: 0.5;
  transition: opacity 0.4s;
}
.inkgun-rail::before,
.inkgun-rail::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #23262e;
  box-shadow: inset 0 0 0 2px #6b7385;
}
.inkgun-rail::before { left: -4px; }
.inkgun-rail::after { right: -4px; }
.inkgun-rig.is-busy .inkgun-rail { opacity: 0.9; }

/* On the trolley: the switch, ON / OFF (safety), and the count (opens the
   list of what it inked), two buttons in one pill */
.inkgun-ctl {
  all: unset;
  --ink: #3255ff;
  position: absolute;
  left: 0;
  top: -5px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px 0 3px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.88);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #f2f3f5;
  font: 800 10.5px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}
.inkgun-ctl:hover { background: rgba(34, 37, 46, 0.94); }
.inkgun-ctl > button { all: unset; display: inline-flex; align-items: center; gap: 6px; align-self: stretch; cursor: pointer; border-radius: 999px; }
.inkgun-ctl > button:focus-visible { outline: 2px solid #8f5bff; outline-offset: 2px; }
.inkgun-ctl .cnt:hover b { text-decoration: underline; text-underline-offset: 2px; }
.inkgun-ctl [hidden] { display: none !important; }
.inkgun-ctl .sw {
  position: relative;
  flex: none;
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: #1f9d55;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), 0 0 8px rgba(61, 220, 132, 0.45);
  transition: background 0.2s, box-shadow 0.2s;
}
.inkgun-ctl .sw i {
  position: absolute;
  top: 2px;
  left: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: left 0.2s;
}
.inkgun-sw[aria-pressed="false"] .sw { background: #4a505e; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.inkgun-sw[aria-pressed="false"] .sw i { left: 2px; }
.inkgun-sw[aria-pressed="false"] .st { color: #ff8a92; }
.inkgun-ctl .cnt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0 999px 999px 0;
  font: 700 11px/1 ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  transform-origin: 30% 50%;
}
.inkgun-ctl .cnt::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 46% 54% 58% 42% / 48% 42% 58% 52%;
  background: var(--ink);
  box-shadow: 0 0 6px var(--ink);
  transition: background 0.25s, box-shadow 0.25s;
}
.inkgun-ctl .cnt small {
  font: 700 9.5px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.7;
}
.inkgun-ctl .cnt small:empty { display: none; }

.inkgun-launcher {
  all: unset;
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  border-radius: 8px;
  pointer-events: none;
}
button.inkgun-launcher { pointer-events: auto; cursor: pointer; }
button.inkgun-launcher:focus-visible { outline: 2px solid #8f5bff; outline-offset: 2px; }
.inkgun-gun {
  --ink: #3255ff;
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.16s ease;
  /* One light shadow: the gun moves every frame, and each shadow is redrawn with it. */
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
  will-change: transform;
}
/* The swinging arm can extend outside the launcher's rectangle. Its painted
   parts remain part of that button; passive demos and hidden rigs do not. */
button.inkgun-launcher .inkgun-gun { pointer-events: visiblePainted; }
.inkgun-rig .inkgun-gun { opacity: 0.96; }
/* Both ON and OFF return to the idle fade. A pointer click leaves the switch
   focused, so focus-within would keep the artwork opaque until another click.
   Only hovering the chooser or visible keyboard focus restores full strength. */
.inkgun-rig.is-idle:not(.is-busy) .inkgun-gun { opacity: 0.78; }
.inkgun-rig.is-safe:not(.is-busy) .inkgun-gun { opacity: 0.60; }
.inkgun-rig.is-idle:not(.is-busy) .inkgun-launcher:hover .inkgun-gun,
.inkgun-rig.is-idle:not(.is-busy):has(:focus-visible) .inkgun-gun,
.inkgun-rig.is-safe:not(.is-busy) .inkgun-launcher:hover .inkgun-gun,
.inkgun-rig.is-safe:not(.is-busy):has(:focus-visible) .inkgun-gun { opacity: 1; }
.inkgun-gun .ig-arm { transform-origin: 24px 8px; }
.inkgun-gun .ig-sway { transform-origin: 24px 8px; }
.inkgun-rig.is-idle .inkgun-gun * { animation: none !important; }
@keyframes inkgun-sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.6deg); }
}
.inkgun-gun .ig-dark { fill: var(--zdark, #23262e); }
.inkgun-gun .ig-bolt { fill: var(--zbolt, #c9ced8); }
.inkgun-gun .ig-body { stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.6; }
.inkgun-gun .ig-bevel { fill: rgba(255, 255, 255, 0.18); pointer-events: none; }
.inkgun-gun .ig-seam { stroke: rgba(0, 0, 0, 0.4); stroke-width: 0.7; fill: none; }
.inkgun-gun .ig-vent { stroke: var(--zvent, #1b1e25); stroke-width: 1.3; stroke-linecap: round; fill: none; }
.inkgun-gun .ig-nozzle { fill: var(--znozzle, #3a404c); }
.inkgun-gun .ig-glassbg { fill: var(--zglass, rgba(10, 12, 18, 0.78)); stroke: rgba(255, 255, 255, 0.3); stroke-width: 0.6; }
.inkgun-gun .ig-glassfx { pointer-events: none; }
.inkgun-gun .ig-status { fill: #3ddc84; }
.inkgun-gun .ig-ink { fill: var(--ink); transition: fill 0.25s ease; }
.inkgun-gun .ig-led {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s ease, opacity 0.25s ease;
  opacity: 0.8;
}
.inkgun-gun .ig-core, .inkgun-gun .ig-ring, .inkgun-gun .ig-mouth, .inkgun-gun .ig-led { transform-box: fill-box; transform-origin: center; }
.inkgun-rig.is-locked .ig-led { opacity: 1; stroke-width: 2; }
@keyframes inkgun-breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.inkgun-gun .ig-wave { animation: inkgun-wave 1.2s linear infinite; }
@keyframes inkgun-wave { to { transform: translateX(-4px); } }
.inkgun-gun .ig-bub { fill: rgba(255, 255, 255, 0.75); animation: inkgun-bubble 2.6s ease-in infinite; }
.inkgun-gun .ig-b2 { animation-delay: 0.9s; }
.inkgun-gun .ig-b3 { animation-delay: 1.7s; }
@keyframes inkgun-bubble {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-15px); opacity: 0; }
}
.inkgun-rig.is-safe .inkgun-gun .ig-ink { fill: #8d95a5; }
.inkgun-rig.is-safe .inkgun-gun .ig-led { stroke: #8d95a5; animation: none; opacity: 0.6; }
.inkgun-rig.is-safe .inkgun-gun .ig-status { fill: #e5484d; }

.inkgun-fx {
  --ink: #3255ff;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
  z-index: 2147482999;
}
.inkgun-laser {
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-dasharray: 2 6;
  opacity: 0;
  transition: opacity 0.15s ease, stroke 0.2s ease;
}
.inkgun-laser.on { opacity: 0.75; }
.inkgun-laser-glow {
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.15s ease, stroke 0.2s ease;
}
.inkgun-laser-glow.on { opacity: 0.16; }
.inkgun-reticle { opacity: 0; transition: opacity 0.15s ease; }
.inkgun-reticle.on { opacity: 0.95; }
.inkgun-reticle circle, .inkgun-reticle path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.inkgun-reticle .dot { fill: var(--ink); stroke: none; }
.inkgun-flash { fill: none; stroke-width: 2.4; }
.inkgun-flash.is-puff { stroke-width: 1.2; }
.inkgun-casing .shell { fill: #c9ced8; stroke: #5b6272; stroke-width: 0.5; }
/* Zapper extras: diamonds, bubbles, glints, lightning, ring and bubble trails */
.inkgun-casing .gem { fill: #bff0ff; stroke: #fff; stroke-width: 0.5; }
.inkgun-casing .bubble { fill: rgba(255, 255, 255, 0.18); stroke: rgba(255, 255, 255, 0.85); stroke-width: 0.7; }
.inkgun-glint { opacity: 0.95; }
.inkgun-zap { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; filter: url(#inkgun-glow); }
.inkgun-bolt { fill: none; stroke: #fff; stroke-width: 1.3; stroke-linejoin: round; opacity: 0.95; }
.inkgun-bolt-glow { fill: none; stroke-width: 4.5; stroke-linejoin: round; opacity: 0.45; filter: url(#inkgun-glow); }
.inkgun-ringtrail { fill: none; stroke-width: 1.6; opacity: 0.8; }
.inkgun-bubtrail { fill: rgba(255, 255, 255, 0.16); stroke-width: 1; opacity: 0.9; }
.inkgun-streak { opacity: 0.85; }
.inkgun-fbub { fill: rgba(255, 255, 255, 0.2); stroke-width: 1; }
.inkgun-smoke { fill: rgba(90, 90, 96, 0.5); stroke: none; }

/* Paint on a post. The frame sits exactly over the text: inside it when the
   text box doesn't clip, otherwise on a parent (".inkgun-stage") with its
   position set from script. */
.inkgun-host { position: relative !important; }
.inkgun-stage { position: relative !important; }
.inkgun-frame {
  position: absolute !important;
  container: socialzap-ink / inline-size;
  display: flex;
  align-items: safe flex-end;
  justify-content: flex-end;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  z-index: 2;
}
/* A frame with a label sits above paint-only frames (photos, clips), so a
   quoted post's label isn't buried under the ink on its picture. */
.inkgun-frame.has-tag { z-index: 3; }
.inkgun-layer {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible !important;
  pointer-events: none !important;
}
/* Words under paint (or waiting for it) are blurred out. No fade: a fade
   on every element inside the post (the paint's shapes included) keeps
   hundreds of transitions running each time a post is painted. */
.inkgun-soaked,
.inkgun-soaked * {
  color: transparent !important;
  text-shadow: 0 0 7px rgba(128, 128, 128, 0.55) !important;
}
.inkgun-fog,
.inkgun-fog * {
  color: transparent !important;
  text-shadow: 0 0 5px rgba(128, 128, 128, 0.75) !important;
}
.inkgun-soaked img,
.inkgun-fog img { filter: blur(3px) opacity(0.5); }
/* A photo or clip inked along with its post: blurred out under the paint. */
.inkgun-mbox.inkgun-soaked > :not(.inkgun-frame),
.inkgun-mbox.inkgun-fog > :not(.inkgun-frame) {
  filter: blur(26px) saturate(0.6) brightness(0.85) !important;
  /* Cover media immediately, including while a baked image is decoding. */
  transition: none !important;
}

/* Explicit post controls. The reason can truncate; action names never do. */
.inkgun-frame .inkgun-tag,
.inkgun-frame .inkgun-tag * {
  color: var(--ink-fg) !important;
  text-shadow: none !important;
}
.inkgun-tag {
  box-sizing: border-box;
  position: relative;
  right: 4px;
  flex: none;
  z-index: 3;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 8px);
  padding: 2px;
  border-radius: 8px;
  background: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font: 600 11.5px/1.3 ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0;
  pointer-events: auto;
  user-select: none;
}
.inkgun-tag.is-top { align-self: flex-start; top: 2px; }
.inkgun-tag-main {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 84px;
  min-height: 26px;
  padding: 3px 4px;
  flex: 1 1 84px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.07);
}
.inkgun-tag-summary { display: inline-flex; align-items: baseline; gap: 5px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
/* Small images and narrow posts prioritise complete action names. The full
   reason remains in the button's accessible name and its explanation. */
@container socialzap-ink (max-width: 350px) {
  .inkgun-tag-summary { display: none; }
}
.inkgun-tag-why { flex: none; white-space: nowrap; font: 700 11px/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.inkgun-tag-main:hover { background: rgba(0, 0, 0, 0.16); }
.inkgun-tag-main:focus-visible { outline: 2px solid var(--ink-fg); outline-offset: 2px; }
.inkgun-tag-g {
  font: 700 11.5px/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
}
.inkgun-tag-p {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
}
.inkgun-tag-more { font-size: 10.5px; }
.inkgun-tag-wipe {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(0, 0, 0, 0.32);
  border-radius: 6px;
  background: var(--ink-fg);
  font: 750 11px/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  flex: none;
}
.inkgun-frame .inkgun-tag .inkgun-tag-wipe { color: var(--ink) !important; text-shadow: none !important; }
.inkgun-tag-wipe:hover { filter: brightness(0.92); }
.inkgun-tag-peek {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 26px;
  padding: 3px 5px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 6px;
  font: 650 11px/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: rgba(0, 0, 0, 0.16);
  cursor: grab;
  flex: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.inkgun-tag-peek:hover { background: rgba(0, 0, 0, 0.28); }
.inkgun-tag-peek.is-held { background: rgba(0, 0, 0, 0.4); cursor: grabbing; }
.inkgun-tag-peek:focus-visible { outline: 2px solid var(--ink-fg); outline-offset: 1px; }
.inkgun-tag-by { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Peeking: the ink lifts while the eye is held */
.inkgun-frame > img.inkgun-baked,
.inkgun-frame > svg.inkgun-layer { transition: opacity 0.22s ease; }
.inkgun-frame.inkgun-peek > img.inkgun-baked,
.inkgun-frame.inkgun-peek > svg.inkgun-layer { opacity: 0 !important; transition: opacity 0.14s ease; }
/* ...and the labels get out of the way of the words: only the eye you are
   holding stays visible; the post's other labels hide. */
.inkgun-frame.inkgun-peek > .inkgun-tag { background: transparent; box-shadow: none; pointer-events: none; }
.inkgun-frame.inkgun-peek .inkgun-tag-peek { pointer-events: auto; }
.inkgun-frame.inkgun-peek > .inkgun-tag > :not(.inkgun-tag-peek),
.inkgun-frame.inkgun-peek > .inkgun-tag:not(.is-holding) { visibility: hidden; }
.inkgun-frame.inkgun-peek .inkgun-tag-peek.is-held { background: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.inkgun-tag-wipe:focus-visible { outline: 2px solid var(--ink-fg); outline-offset: 1px; }

/* The squeegee */
.inkgun-blade {
  position: absolute;
  left: 0;
  top: -18px;
  width: 8px;
  z-index: 4;
  border-radius: 4px;
  background: linear-gradient(90deg, #2a2d34, #4b515d 60%, #2a2d34);
  box-shadow: -12px 0 16px -8px var(--ink), 0 2px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transform-origin: 50% 50%;
}

/* "Ink this" in X's action bar */
.inkgun-this {
  all: unset;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 4px;
  border-radius: 999px;
  color: var(--ig-c, rgb(113, 118, 123));
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.inkgun-this svg { width: 19px; height: 19px; }
.inkgun-this.is-new { width: 38px; height: 36px; margin: 0; }
.inkgun-this.is-new svg { width: 18px; height: 18px; }
.inkgun-this:hover { background: rgba(143, 91, 255, 0.14); color: #8f5bff; }
.inkgun-this:focus-visible { outline: 2px solid #8f5bff; outline-offset: 1px; }

/* Controls survive wipe/reset and X replacing a media wrapper. Their size
   belongs to the control, never to the renderer's temporary paint class. */
.inkgun-image-this[data-inkgun-ui] {
  all: unset;
  position: absolute; right: 3px; top: 3px; bottom: auto; z-index: 3;
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  min-width: 40px; max-width: 40px; min-height: 40px; max-height: 40px;
  box-sizing: border-box; flex: none;
  border-radius: 50%; color: #fff;
  cursor: pointer; opacity: .55;
}
/* The idle target lets the picture show through; focus restores contrast. */
.inkgun-image-this[data-inkgun-ui]:hover,
.inkgun-image-this[data-inkgun-ui]:focus-visible,
.inkgun-image-this[data-inkgun-ui][aria-expanded="true"] { opacity: 1; }
/* The hit area stays generous; the disc covers only 32px of the media. */
.inkgun-image-this[data-inkgun-ui]::before {
  content: ''; position: absolute; inset: 4px; box-sizing: border-box;
  border: 1.5px solid #fff; border-radius: 50%; background: #4c22a8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .55); pointer-events: none;
}
.inkgun-image-this[data-inkgun-ui] svg { position: relative; width: 18px; height: 18px; min-width: 18px; max-width: 18px; min-height: 18px; max-height: 18px; }
.inkgun-image-this[data-inkgun-ui]:hover::before { background: #6532cf; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.inkgun-image-this[data-inkgun-ui]:focus-visible { outline: none; }
.inkgun-image-this[data-inkgun-ui]:focus-visible::before { box-shadow: 0 0 0 2px #151222, 0 0 0 4px #fff; }
.inkgun-off .inkgun-rig { display: none; }
/* A dialog covers the page (a photo, the compose box): the gun steps aside. */
.inkgun-rig.is-paused, .inkgun-fx.is-paused { visibility: hidden !important; }
/* The idle gun holds still after a few seconds, so the page isn't redrawn for nothing. */
.inkgun-rig.is-asleep .inkgun-gun,
.inkgun-rig.is-asleep .inkgun-gun * { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .inkgun-gun, .inkgun-rail, .inkgun-ctl *, .inkgun-fx *,
  .inkgun-frame > img.inkgun-baked, .inkgun-frame > svg.inkgun-layer,
  .inkgun-mbox.inkgun-soaked > :not(.inkgun-frame),
  .inkgun-mbox.inkgun-fog > :not(.inkgun-frame) { transition: none !important; }
  .inkgun-rig.is-idle .ig-sway,
  .inkgun-gun .ig-wave,
  .inkgun-gun .ig-bub,
  .inkgun-rig.is-idle .ig-led,
  .inkgun-rig.is-idle .ig-core,
  .inkgun-rig.is-idle .ig-ring { animation: none; }
}

/* A finished splat, baked into one picture */
.inkgun-frame > img.inkgun-baked {
  position: absolute !important;
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 1 !important;
  filter: none !important;
  pointer-events: none !important;
  user-select: none;
}
