/* ========================================================
   Precision Blueprint SVG Visualizer Styles
   ======================================================== */
.pzi {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 380px;
  overflow: visible;
}

.pzi :is(path, circle, rect, line, polygon) {
  vector-effect: non-scaling-stroke;
}

/* Controller Shell Body */
.pzi-body {
  fill: var(--tile, #ffffff) !important;
  stroke: var(--ink-3, #94a3b8) !important;
  stroke-width: 1.5px !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.07));
}

:root[data-theme="dark"] .pzi-body,
html.dark .pzi-body {
  fill: #141518 !important;
  stroke: #3f3f46 !important;
}

/* Trigger housing and caps */
.pzi-trg {
  fill: var(--tile, #ffffff) !important;
}
:root[data-theme="dark"] .pzi-trg,
html.dark .pzi-trg {
  fill: #141518 !important;
}

.pzi-tl {
  fill: none !important;
  stroke: var(--ink-3, #94a3b8) !important;
  stroke-width: 1.5px !important;
  stroke-linejoin: round !important;
}
:root[data-theme="dark"] .pzi-tl,
html.dark .pzi-tl {
  stroke: #3f3f46 !important;
}

/* Trigger fill level (neon green) */
.pzi-tf {
  fill: #3DFF8B !important;
  transform: translateY(0);
}

/* Detail seams, contour lines */
.pzi-dt {
  fill: none !important;
  stroke: var(--ink-5, #cbd5e1) !important;
  stroke-width: 1px !important;
}
:root[data-theme="dark"] .pzi-dt,
html.dark .pzi-dt {
  stroke: #2e3036 !important;
}

/* Recessed wells for sticks and D-pad */
.pzi-well {
  fill: var(--soft, #f1f3f7) !important;
  stroke: var(--ink-4, #cbd5e1) !important;
  stroke-width: 1.2px !important;
}
:root[data-theme="dark"] .pzi-well,
html.dark .pzi-well {
  fill: #1a1b1f !important;
  stroke: #353840 !important;
}

/* Stick axis ticks / crosshairs */
.pzi-tk {
  fill: none !important;
  stroke: var(--ink-4, #cbd5e1) !important;
  stroke-width: 1px !important;
}
:root[data-theme="dark"] .pzi-tk,
html.dark .pzi-tk {
  stroke: #353840 !important;
}

/* Center D-pad hub */
.pzi-hub {
  fill: var(--tile, #ffffff) !important;
  stroke: none !important;
}
:root[data-theme="dark"] .pzi-hub,
html.dark .pzi-hub {
  fill: #24252a !important;
}

/* Button & Stick face caps */
.pzi-f {
  fill: var(--tile, #ffffff) !important;
  stroke: var(--ink-3, #64748b) !important;
  stroke-width: 1.2px !important;
}
:root[data-theme="dark"] .pzi-f,
html.dark .pzi-f {
  fill: #24252a !important;
  stroke: #52525b !important;
}

/* Thumbstick grip texture circle */
.pzi-cd {
  fill: none !important;
  stroke: var(--ink-5, #cbd5e1) !important;
  stroke-width: 1px !important;
}
:root[data-theme="dark"] .pzi-cd,
html.dark .pzi-cd {
  stroke: #353840 !important;
}

/* Button glyphs (View, Menu, Home) */
.pzi-g {
  fill: none !important;
  stroke: var(--ink-3, #334155) !important;
  stroke-width: 1.3px !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
:root[data-theme="dark"] .pzi-g,
html.dark .pzi-g {
  stroke: #94a3b8 !important;
}

/* Button text labels (A, B, X, Y) */
svg text.pzi-l {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  fill: var(--ink-3, #334155) !important;
  font-weight: 700 !important;
  user-select: none;
}
:root[data-theme="dark"] svg text.pzi-l,
html.dark svg text.pzi-l {
  fill: #e2e8f0 !important;
}

/* ========================================================
   ACTIVE & PRESSED STATES (NEON GREEN HIGHLIGHT)
   ======================================================== */
.pzi-k.ok .pzi-f,
.pzi-k.ok.pzi-f {
  stroke: #00c957 !important;
}

.pzi-k.on .pzi-f,
.pzi-k.on.pzi-f {
  fill: #3DFF8B !important;
  stroke: #00c957 !important;
  filter: drop-shadow(0 0 8px rgba(61, 255, 139, 0.7));
}

.pzi-k.on .pzi-g,
.pzi-k.on .pzi-cd {
  stroke: #07130b !important;
}

svg .pzi-k.on text.pzi-l {
  fill: #07130b !important;
  font-weight: 900 !important;
}

/* ========================================================
   THUMBSTICK ZERO-LATENCY HARDWARE SMOOTHNESS
   NO CSS TRANSITIONS TO PREVENT RAF CONFLICT / JITTER
   ======================================================== */
.pzi-cap {
  transform-box: view-box !important;
  transition: none !important;
  will-change: transform;
}

.pzi-cap * {
  transition: none !important;
}

/* Callout leader lines and dots */
.pzi-ld {
  fill: none !important;
  stroke: var(--ink-4, #94a3b8) !important;
  stroke-width: 1px !important;
  stroke-dasharray: 2 2 !important;
}
:root[data-theme="dark"] .pzi-ld,
html.dark .pzi-ld {
  stroke: #475569 !important;
}

.pzi-dot {
  fill: var(--ink-3, #64748b) !important;
}
:root[data-theme="dark"] .pzi-dot,
html.dark .pzi-dot {
  fill: #94a3b8 !important;
}

svg text.pzi-cn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  fill: var(--ink-3, #64748b) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
:root[data-theme="dark"] svg text.pzi-cn,
html.dark svg text.pzi-cn {
  fill: #94a3b8 !important;
}

svg text.pzi-cv {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  fill: var(--ink, #0f172a) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
:root[data-theme="dark"] svg text.pzi-cv,
html.dark svg text.pzi-cv {
  fill: #f8fafc !important;
}

.pzi-call.on .pzi-dot {
  fill: #3DFF8B !important;
}

.pzi-call.on .pzi-ld {
  stroke: #3DFF8B !important;
}

.pzi-call.on text.pzi-cv {
  fill: #3DFF8B !important;
  font-weight: 700 !important;
}

/* Vibration wave rings */
.pzi-m {
  visibility: hidden;
}

.pzi-m circle {
  fill: none !important;
  stroke: #3DFF8B !important;
  stroke-width: 1.5px !important;
  transform-box: fill-box;
  transform-origin: 50%;
}

[data-vm="all"] .pzi-m,
.pzi-m.on {
  visibility: visible !important;
}

[data-vm="all"] .pzi-m circle,
.pzi-m.on circle {
  animation: 1s ease-out infinite gt-ring;
}

[data-vm="all"] .pzi-m circle:nth-child(2),
.pzi-m.on circle:nth-child(2) {
  animation-delay: -0.33s;
}

[data-vm="all"] .pzi-m circle:nth-child(3),
.pzi-m.on circle:nth-child(3) {
  animation-delay: -0.67s;
}

@keyframes gt-ring {
  0% {
    opacity: 1;
    transform: scale(0.35);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}
