* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --fondo: #04070a;
  --ventana: #0e1319;
  --borde: #2b3540;
  --barra: #1b222b;
  --texto: #cfd9e3;
  --tenue: #7d8b99;
  --rojo: #ff3b30;
  --verde: #3dff8f;
  --ambar: #ffb02e;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  overflow: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
}

#hud {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 75;
  font-size: 12px;
}

.hud-caja {
  background: rgba(8, 12, 16, 0.9);
  border: 1px solid var(--borde);
  padding: 6px 14px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.hud-rojo {
  border-color: var(--rojo);
  color: #ff8a80;
}

.punto {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rojo);
  margin-right: 8px;
  vertical-align: middle;
  animation: parpadeo 1s steps(1) infinite;
}

#boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #020403;
  padding: 6vh 6vw;
  transition: opacity 0.5s ease;
}

#boot.ocultando {
  opacity: 0;
}

#boot-texto {
  color: var(--verde);
  font-size: clamp(12px, 1.5vw, 17px);
  line-height: 1.9;
  text-shadow: 0 0 8px rgba(61, 255, 143, 0.5);
  white-space: pre-wrap;
}

#boot-texto::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 1em;
  background: var(--verde);
  vertical-align: text-bottom;
  animation: parpadeo 0.8s steps(1) infinite;
}

#captura {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  place-items: center;
  background: rgba(2, 4, 6, 0.93);
}

.captura-dialogo {
  width: min(460px, 92vw);
  background: #12161c;
  border: 1px solid var(--borde);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75);
}

.captura-titulo {
  background: linear-gradient(180deg, #232c36, #171e26);
  border-bottom: 1px solid var(--borde);
  padding: 11px 15px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #9fb2c3;
}

.captura-texto {
  padding: 26px 20px 4px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--texto);
}

#captura-boton {
  display: block;
  width: calc(100% - 40px);
  margin: 18px 20px 24px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: #ffffff;
  background: #1f6feb;
  border: 1px solid #388bfd;
  cursor: pointer;
}

#captura-boton:hover {
  background: #388bfd;
}

#escritorio {
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 700px at 30% 20%, #0b1420, #04070a 60%);
}

.ventana {
  display: none;
  position: absolute;
  flex-direction: column;
  background: var(--ventana);
  border: 1px solid var(--borde);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.7);
  max-height: 74vh;
}

.ventana.abierta {
  display: flex;
  animation: entra 0.25s ease-out;
}

.ventana-barra {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #232c36, #171e26);
  border-bottom: 1px solid var(--borde);
  padding: 8px 10px;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.icono {
  width: 12px;
  height: 12px;
  flex: none;
}

.icono-verde {
  background: var(--verde);
  box-shadow: 0 0 8px rgba(61, 255, 143, 0.8);
}

.icono-naranja {
  background: var(--ambar);
  box-shadow: 0 0 8px rgba(255, 176, 46, 0.8);
}

.icono-rojo {
  background: var(--rojo);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.8);
}

.ventana-titulo {
  flex: 1;
  font-size: 12px;
  color: #9fb2c3;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ventana-acciones {
  display: flex;
  gap: 6px;
}

.ventana-acciones i {
  font-style: normal;
  font-size: 11px;
  color: var(--tenue);
  border: 1px solid var(--borde);
  width: 18px;
  height: 16px;
  display: grid;
  place-items: center;
  cursor: default;
}

.ventana-acciones i.cierra:hover {
  color: #fff;
  background: var(--rojo);
  border-color: var(--rojo);
}

.ventana-cuerpo {
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.65;
  overflow: hidden;
}

.ventana-cuerpo.terminal {
  background: #050907;
}

#v-fuentes {
  left: 4%;
  top: 8%;
  width: min(470px, 92vw);
}

#v-extraccion {
  right: 4%;
  top: 12%;
  width: min(500px, 94vw);
}

#v-sql {
  left: 16%;
  top: 46%;
  width: min(430px, 92vw);
}

#v-backup {
  right: 7%;
  top: 52%;
  width: min(450px, 92vw);
}

.linea {
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal .linea {
  color: var(--verde);
  text-shadow: 0 0 6px rgba(61, 255, 143, 0.35);
}

.linea-ok {
  color: var(--verde);
  font-weight: 700;
}

.linea-alerta {
  color: #ff6b61;
  background: rgba(255, 59, 48, 0.12);
  border-left: 3px solid var(--rojo);
  padding-left: 6px;
}

.linea-borrado {
  color: #66717c;
  text-decoration: line-through;
}

.linea-propio {
  color: #fff;
  background: rgba(255, 59, 48, 0.4);
  font-weight: 700;
  padding-left: 6px;
}

.lista {
  margin-top: 8px;
  max-height: 240px;
  overflow: hidden;
}

.ruta {
  color: var(--ambar);
  font-size: 12px;
  word-break: break-all;
}

.barra {
  height: 16px;
  background: #0a0e13;
  border: 1px solid var(--borde);
  margin: 10px 0 6px;
}

.barra i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ambar), var(--rojo));
  transition: width 0.3s linear;
}

.barra-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--tenue);
}

.contador {
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 700;
  color: var(--rojo);
  text-shadow: 0 0 18px rgba(255, 59, 48, 0.5);
}

.subtexto {
  font-size: 11px;
  color: var(--tenue);
  letter-spacing: 0.06em;
}

.aviso-titulo {
  background: linear-gradient(180deg, #c62828, #8e0f0f);
  color: #ffe9e7;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  margin: -12px -14px 14px;
}

.aviso-texto {
  font-size: 14.5px;
  line-height: 1.75;
  color: #ffe9e7;
}

.aviso-nota {
  margin-top: 12px;
  color: #a17c78;
  font-size: 12px;
}

#barra-tareas {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  background: rgba(10, 14, 19, 0.97);
  border-top: 1px solid var(--borde);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  z-index: 60;
  font-size: 12px;
}

.tb-inicio {
  border: 1px solid var(--borde);
  background: #131a22;
  padding: 6px 14px;
  letter-spacing: 0.05em;
}

#tb-ventanas {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}

.tb-app {
  font-family: inherit;
  font-size: 11px;
  color: var(--texto);
  background: #101720;
  border: 1px solid var(--borde);
  padding: 6px 12px;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-app:hover {
  background: #1a232e;
}

#tb-derecha {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--tenue);
}

.tb-rec {
  color: var(--rojo);
  animation: parpadeo 1.4s steps(1) infinite;
  letter-spacing: 0.08em;
}

#tb-reloj {
  font-variant-numeric: tabular-nums;
}

#v-alerta {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
}

.alerta-dialogo {
  width: min(640px, 92vw);
  background: #12161c;
  border: 1px solid var(--rojo);
  box-shadow: 0 0 70px rgba(255, 59, 48, 0.4);
}

.temblar {
  animation: temblor 0.35s linear 2;
}

.alerta-barra {
  background: linear-gradient(180deg, #c62828, #8e0f0f);
  color: #ffe9e7;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
}

.alerta-cuerpo {
  padding: 24px 22px;
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.75;
  color: #ffe9e7;
}

.alerta-pie {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 20px;
}

.alerta-pie button {
  font-family: inherit;
  font-size: 13px;
  padding: 9px 22px;
  background: #1a2029;
  color: var(--texto);
  border: 1px solid var(--borde);
  cursor: pointer;
  letter-spacing: 0.05em;
}

.alerta-pie button:hover {
  background: var(--rojo);
  border-color: var(--rojo);
  color: #fff;
}

#rescate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, #1a0000 0%, #000 72%);
}

.rescate-tarjeta {
  max-width: 780px;
}

.rescate-senal {
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  border: 4px solid var(--rojo);
  border-radius: 50%;
  color: var(--rojo);
  font-size: 44px;
  font-weight: 700;
  display: grid;
  place-items: center;
  text-shadow: 0 0 16px rgba(255, 59, 48, 0.8);
  box-shadow: 0 0 34px rgba(255, 59, 48, 0.45);
}

#rescate h1 {
  font-size: clamp(26px, 5.5vw, 56px);
  color: var(--rojo);
  letter-spacing: 0.06em;
  text-shadow: 0 0 26px rgba(255, 59, 48, 0.65);
  animation: latido 1.6s ease-in-out infinite;
}

.rescate-mensaje {
  margin-top: 22px;
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.8;
  color: #ffd9d5;
}

.rescate-contador {
  margin-top: 26px;
  font-size: clamp(44px, 9vw, 96px);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.35);
}

.rescate-nota {
  margin-top: 8px;
  font-size: 12px;
  color: #a17c78;
  letter-spacing: 0.05em;
}

#fin {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  background: #000;
}

.fin-texto {
  color: #3a4753;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: lowercase;
}

#expirado {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  text-align: center;
  background: #0b0e11;
}

.expirado-texto {
  color: #8b97a3;
  font-size: clamp(15px, 2.4vw, 19px);
  line-height: 2.2;
}

.expirado-texto span {
  display: block;
  font-size: 12.5px;
  color: #4d5865;
}

@keyframes entra {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes parpadeo {
  50% {
    opacity: 0.15;
  }
}

@keyframes temblor {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

@keyframes latido {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@media (max-width: 760px) {
  #hud {
    font-size: 10px;
    gap: 6px;
  }

  .hud-caja {
    padding: 5px 8px;
  }

  #v-fuentes,
  #v-extraccion,
  #v-sql,
  #v-backup {
    left: 3vw;
    right: auto;
    width: 94vw;
  }

  #v-fuentes {
    top: 5%;
  }

  #v-extraccion {
    top: 25%;
  }

  #v-sql {
    top: 45%;
  }

  #v-backup {
    top: 65%;
  }

  .ventana-cuerpo {
    font-size: 11.5px;
  }
}
