/* From Uiverse.io by Gidarx - https://uiverse.io/Gidarx/moody-falcon-73
   MIT License, Copyright (c) Gidarx (Gidarx)
   Pantalla LCD del Mini Módulo: misma UI, fondo azul y letras blancas. */

.vi-mod-shot {
  position: relative;
  width: 100%;
  line-height: 0;
}

.vi-mod-shot > img {
  width: 100%;
  height: auto;
  display: block;
}

.vi-mod-shot .vi-pipboy {
  position: absolute;
  /* LCD interno medido en modulo-card.png; un pelín más para tapar el texto original */
  left: 17.9%;
  top: 40.3%;
  width: 65.8%;
  height: 25.8%;
  z-index: 2;
  display: block;
  background: var(--bg-dark);
  border-radius: 2px;
  overflow: hidden;
}

.vi-pipboy {
  --pip-green: #ffffff;
  --pip-glow: rgba(255, 255, 255, 0.55);
  --bg-dark: #0047e0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
  box-sizing: border-box;
  container-type: size;
  container-name: vi-pipboy;
  color: var(--pip-green);
}

.vi-pipboy *,
.vi-pipboy *::before,
.vi-pipboy *::after {
  box-sizing: border-box;
}

.vi-pipboy ::selection {
  background-color: var(--pip-green);
  color: var(--bg-dark);
  text-shadow: none;
}

.vi-pipboy ::-moz-selection {
  background-color: var(--pip-green);
  color: var(--bg-dark);
  text-shadow: none;
}

.vi-pipboy > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.vi-pip-crt {
  background-color: var(--bg-dark);
  border-radius: 0;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 40, 0.35);
  width: auto;
  height: auto;
  cursor: pointer;
}

.vi-pip-glass {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 28%,
    rgba(0, 0, 40, 0.12) 100%
  );
}

.vi-pip-glass::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 18%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  animation: viPipCrtScanline 7s linear infinite;
  pointer-events: none;
  z-index: 11;
}

.vi-pip-scan {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: linear-gradient(rgba(0, 20, 80, 0) 50%, rgba(0, 0, 40, 0.18) 50%);
  background-size: 100% 2px;
}

.vi-pip-boot {
  height: 100%;
  padding: 2px 4px 1px;
  display: flex;
  flex-direction: column;
  color: var(--pip-green);
  text-shadow: 0 0 3px var(--pip-glow);
  animation: viPipTurnOn 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0;
}

.vi-pip-bold { font-weight: 900; }

.vi-pip-line {
  height: 1px;
  background-color: var(--pip-green);
  box-shadow: 0 0 4px var(--pip-glow);
  opacity: 0.75;
}

.vi-pip-flex {
  flex-grow: 1;
  margin: 0 3px;
}

.vi-pip-top,
.vi-pip-bottom {
  display: flex;
  align-items: center;
  font-size: 5.5px;
  font-weight: bold;
  letter-spacing: 0.04em;
  line-height: 1;
}

.vi-pip-top { margin-bottom: 1px; }

.vi-pip-title {
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
  flex-shrink: 0;
}

.vi-pip-stats {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.vi-pip-bottom { margin-top: auto; }

.vi-pip-nav {
  padding: 1px 3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  margin: 0;
  font: inherit;
  font-weight: bold;
  color: inherit;
  text-transform: uppercase;
  line-height: 1.1;
  display: inline-block;
}

.vi-pip-nav:hover {
  background-color: rgba(255, 255, 255, 0.18);
}

.vi-pip-mid {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.vi-pip-pane {
  display: none;
  width: 100%;
  height: 100%;
  animation: viPipGlitch 0.4s ease-out;
}

.vi-pipboy:has(.vi-pip-in-stat:checked) .vi-pip-pane-stat,
.vi-pipboy:has(.vi-pip-in-inv:checked) .vi-pip-pane-inv,
.vi-pipboy:has(.vi-pip-in-data:checked) .vi-pip-pane-data {
  display: flex;
}

.vi-pipboy:has(.vi-pip-in-stat:checked) .vi-pip-nav[for$="-stat"],
.vi-pipboy:has(.vi-pip-in-inv:checked) .vi-pip-nav[for$="-inv"],
.vi-pipboy:has(.vi-pip-in-data:checked) .vi-pip-nav[for$="-data"] {
  background-color: var(--pip-green);
  color: var(--bg-dark);
  text-shadow: none;
  box-shadow: 0 0 6px var(--pip-glow);
}

.vi-pip-pane-stat {
  justify-content: center;
  align-items: center;
  gap: 0;
}

.vi-pip-side,
.vi-pip-right {
  display: none;
}

.vi-pip-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.vi-pip-block {
  background-color: var(--pip-green);
  border-radius: 2px;
  padding: 1px 6px;
  margin-bottom: 1px;
  box-shadow: 0 0 8px var(--pip-glow);
  animation: viPipBlockPulse 4s infinite alternate;
}

.vi-pip-time {
  color: var(--bg-dark) !important;
  font-size: 11px;
  font-weight: bold;
  text-shadow: none;
  filter: none;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.vi-pip-date {
  font-size: 6.5px;
  font-weight: bold;
  letter-spacing: 0.6px;
  text-align: center;
}

.vi-pip-hazard {
  display: none;
}

.vi-pip-pane-inv {
  flex-direction: column;
  font-size: 8px;
  width: 100%;
  justify-content: center;
  overflow: hidden;
}

.vi-pip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.vi-pip-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 1px 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.vi-pip-list li:hover,
.vi-pip-list .vi-pip-active {
  background-color: var(--pip-green);
  color: var(--bg-dark);
  font-weight: bold;
  text-shadow: none;
  box-shadow: none;
}

.vi-pip-pane-data {
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 6px;
}

.vi-pip-radar {
  position: relative;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 6px var(--pip-glow);
  border: 1px solid var(--pip-green);
  flex-shrink: 0;
}

.vi-pip-radar::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

.vi-pip-radar::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border: 1px solid var(--pip-green);
}

.vi-pip-radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: transparent;
  transform-origin: top left;
  animation: viPipSweep 2s linear infinite;
  box-shadow: 3px -12px 8px -6px var(--pip-green);
  border-top: 1px solid var(--pip-green);
  z-index: 2;
}

.vi-pip-blip {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  top: 4px;
  left: 11px;
  box-shadow: 0 0 4px #fff;
  animation: viPipBlip 2s infinite;
  z-index: 3;
}

.vi-pip-radar-txt {
  font-size: 5.5px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-align: center;
}

.vi-pip-eq {
  display: flex;
  gap: 1px;
  align-items: flex-end;
  height: 7px;
  margin-left: 2px;
}

.vi-pip-eq-bar {
  width: 2px;
  background-color: var(--pip-green);
  animation: viPipEq 1s infinite alternate;
}

.vi-pip-eq-bar:nth-child(1) { animation-delay: 0.1s; }
.vi-pip-eq-bar:nth-child(2) { animation-delay: 0.3s; }
.vi-pip-eq-bar:nth-child(3) { animation-delay: 0s; }
.vi-pip-eq-bar:nth-child(4) { animation-delay: 0.4s; }

.vi-pip-colon {
  animation: viPipBlink 1s step-end infinite;
}

.vi-pip-flicker {
  animation: viPipFlicker 0.15s infinite;
}

.vi-pip-flicker-fast {
  animation: viPipFlicker 0.08s infinite;
}

.vi-pip-pulse {
  animation: viPipPulse 1.5s infinite ease-in-out;
}

.serial-ticket-wrap .luminous-icon:has(.vi-pipboy) {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  margin: 0 0 0.55rem;
  filter: none !important;
}

.serial-ticket-wrap .luminous-card:has(.vi-pipboy) {
  height: auto;
  min-height: 0;
  justify-content: flex-start;
  padding-top: 0.65rem;
}

.serial-ticket-wrap .luminous-card:has(.vi-pipboy)::before {
  display: none;
}

.serial-ticket-wrap .luminous-card:not(.is-lit) .vi-pipboy {
  filter: brightness(0.38) saturate(0.85);
}

@keyframes viPipGlitch {
  0% {
    opacity: 0;
    filter: contrast(200%);
    transform: translateY(-1px);
    text-shadow: 2px 0 rgba(255, 0, 0, 0.5), -2px 0 rgba(0, 0, 255, 0.5);
  }
  20% {
    opacity: 0.8;
    text-shadow: -2px 0 rgba(255, 0, 0, 0.5), 2px 0 rgba(0, 0, 255, 0.5);
  }
  50% {
    opacity: 0.5;
    filter: contrast(150%);
    transform: translateY(1px);
  }
  100% {
    opacity: 1;
    filter: contrast(100%);
    transform: translateY(0);
    text-shadow: 0 0 3px var(--pip-glow);
  }
}

@keyframes viPipCrtScanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(800%); }
}

@keyframes viPipTurnOn {
  0% { transform: scale(1, 0.005); opacity: 0; filter: brightness(10); }
  30% { transform: scale(1, 0.005); opacity: 1; filter: brightness(5); }
  60% { transform: scale(1, 1); filter: brightness(2); }
  100% { transform: scale(1, 1); opacity: 1; filter: brightness(1); }
}

@keyframes viPipSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes viPipRadarSpin {
  100% { transform: rotate(360deg); }
}

@keyframes viPipBlip {
  0%, 85% { opacity: 0; }
  90% { opacity: 1; transform: scale(1.5); }
  100% { opacity: 0; }
}

@keyframes viPipEq {
  0% { height: 2px; }
  100% { height: 7px; }
}

@keyframes viPipBlockPulse {
  0% { box-shadow: 0 0 4px var(--pip-glow); }
  100% { box-shadow: 0 0 10px var(--pip-glow); }
}

@keyframes viPipBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes viPipFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

@keyframes viPipPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
